summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c9c676)
raw | patch | inline | side by side (parent: 9c9c676)
author | joncruz <joncruz@users.sourceforge.net> | |
Fri, 20 Apr 2007 08:33:54 +0000 (08:33 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Fri, 20 Apr 2007 08:33:54 +0000 (08:33 +0000) |
Working on bug #146955
share/icons/icons.svg | patch | blob | history | |
src/widgets/toolbox.cpp | patch | blob | history |
diff --git a/share/icons/icons.svg b/share/icons/icons.svg
index 3007737153ce7985fe03bae613c6c54dc8447df1..b1e578200da156fd16d4961e8f7f896cfe92ab30 100644 (file)
--- a/share/icons/icons.svg
+++ b/share/icons/icons.svg
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs3">
+ <linearGradient
+ id="linearGradient7944">
+ <stop
+ style="stop-color:#3daff6;stop-opacity:1;"
+ offset="0"
+ id="stop7946" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop7948" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5376"
+ id="linearGradient5775"
+ x1="508.50006"
+ y1="154.99997"
+ x2="508.50006"
+ y2="162.32036"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(0,1.7e-6)" />
+ <linearGradient
+ id="linearGradient5376">
+ <stop
+ id="stop5378"
+ offset="0"
+ style="stop-color:#3daff6;stop-opacity:1;" />
+ <stop
+ id="stop5380"
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient7944"
+ id="linearGradient4394"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(71.737908,-613.10672)"
+ x1="436.76215"
+ y1="768.10669"
+ x2="436.76215"
+ y2="775.42706" />
<linearGradient
id="linearGradient4798">
<stop
y1="174.4991"
x2="117.8272"
y2="183.32233" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5704"
- id="linearGradient8400"
- gradientUnits="userSpaceOnUse"
- x1="98.531143"
- y1="191.04416"
- x2="101.69498"
- y2="195.88911" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient6679"
- id="linearGradient8402"
- gradientUnits="userSpaceOnUse"
- x1="102.72185"
- y1="197.65771"
- x2="98.802040"
- y2="191.23259" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient6679"
- id="linearGradient8404"
- gradientUnits="userSpaceOnUse"
- x1="109.28288"
- y1="199.97221"
- x2="99.931625"
- y2="190.28522" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient6679"
- id="linearGradient8418"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.993471,0,0,1.011109,-336.7354,-1.230434)"
- x1="456.73318"
- y1="187.25432"
- x2="452.48590"
- y2="178.00641" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient6679"
- id="linearGradient8420"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.993471,0,0,1.011109,-336.7354,-1.230434)"
- x1="464.50012"
- y1="190.85718"
- x2="454.03549"
- y2="180.20343" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5704"
- id="linearGradient8422"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(0.326697,0.275583)"
- x1="109.99998"
- y1="174.4991"
- x2="117.8272"
- y2="183.32233" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5704"
y1="199.97221"
x2="99.931625"
y2="190.28522" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5704"
- id="linearGradient9327"
- gradientUnits="userSpaceOnUse"
- x1="695.0141"
- y1="304.22421"
- x2="698.72687"
- y2="309.73383" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1610"
gradientTransform="matrix(1.0621969,0,0,0.9973142,-1261.9238,1.5933312)" />
<linearGradient
inkscape:collect="always"
- xlink:href="#linearGradient5704"
- id="linearGradient4328"
- gradientUnits="userSpaceOnUse"
- x1="113.7436"
- y1="149.37389"
- x2="123.97673"
- y2="167.55257"
- gradientTransform="translate(-60.34214,0)" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient5899"
- id="linearGradient4330"
+ xlink:href="#linearGradient7944"
+ id="linearGradient9119"
gradientUnits="userSpaceOnUse"
- x1="113.17024"
- y1="154.33151"
- x2="129.23041"
- y2="172.62581"
- gradientTransform="translate(-67.877238,0)" />
+ gradientTransform="translate(51.737908,-613.10672)"
+ x1="454.95587"
+ y1="768.10669"
+ x2="454.97092"
+ y2="774.82257" />
<linearGradient
inkscape:collect="always"
- xlink:href="#linearGradient5899"
- id="linearGradient4332"
+ xlink:href="#linearGradient5376"
+ id="linearGradient9121"
gradientUnits="userSpaceOnUse"
- x1="115.92701"
- y1="156.459"
- x2="137.9319"
- y2="180.11198"
- gradientTransform="translate(-67.877238,0)" />
+ gradientTransform="translate(-20,-1.8e-6)"
+ x1="526.69379"
+ y1="154.99997"
+ x2="526.70886"
+ y2="161.71585" />
</defs>
<sodipodi:namedview
inkscape:guide-bbox="true"
d="M 514,158 A 6,6 0 1 1 505,152.80385"
sodipodi:open="true" />
</g>
+ <g
+ id="color_alpha_get"
+ style="opacity:1;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ transform="translate(0,269)">
+ <rect
+ y="150"
+ x="500"
+ height="16"
+ width="16"
+ id="rect4328"
+ style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1" />
+ <path
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 509,156 L 508,156 L 508,157 L 507,157 L 507,158 L 506,158 L 506,159 L 508,159 L 508,164 L 509,163 L 509,159 L 511,159 L 511,158 L 510,158 C 510,158 510,157 510,157 L 509,157 L 509,156 z"
+ id="path4339"
+ sodipodi:nodetypes="ccccccccccccccccc" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path4336"
+ d="M 504.50005,157.49995 L 515.50005,157.49995 L 511.50005,152.49995 L 500.50005,152.49995 L 504.50005,157.49995 z"
+ style="opacity:1;color:#000000;fill:url(#linearGradient4394);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5775);stroke-width:1;stroke-linecap:square;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline" />
+ </g>
+ <g
+ id="color_alpha_set"
+ style="opacity:1;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ transform="translate(20,269)">
+ <rect
+ y="150"
+ x="500"
+ height="16"
+ width="16"
+ id="rect9113"
+ style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1" />
+ <path
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 509,164 L 508,164 L 508,163 L 507,163 L 507,162 L 506,162 L 506,161 L 508,161 L 508,156 L 509,157 L 509,161 L 511,161 L 511,162 L 510,162 C 510,162 510,163 510,163 L 509,163 L 509,164 z"
+ id="path9115"
+ sodipodi:nodetypes="ccccccccccccccccc" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path9117"
+ d="M 504.50005,157.49995 L 515.50005,157.49995 L 511.50005,152.49995 L 500.50005,152.49995 L 504.50005,157.49995 z"
+ style="opacity:1;color:#000000;fill:url(#linearGradient9119);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient9121);stroke-width:1;stroke-linecap:square;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline" />
+ </g>
</svg>
index 3cf9565702ba532b726f922cf93dca28e95235ea..6c3c24183c2ac12b02feec44cf00baeeaaae96ca 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
static void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
static void sp_pen_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
static void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
-static GtkWidget *sp_dropper_toolbox_new(SPDesktop *desktop);
+static void sp_dropper_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
static GtkWidget *sp_empty_toolbox_new(SPDesktop *desktop);
static GtkWidget *sp_connector_toolbox_new(SPDesktop *desktop);
static void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS, "tools.calligraphic", _("Style of new calligraphic strokes")},
{ "SPTextContext", "text_toolbox", sp_text_toolbox_new, 0, 0,
SP_VERB_INVALID, 0, 0},
- { "SPDropperContext", "dropper_toolbox", sp_dropper_toolbox_new, 0, 0,
+ { "SPDropperContext", "dropper_toolbox", 0, sp_dropper_toolbox_prep, "DropperToolbar",
SP_VERB_INVALID, 0, 0},
{ "SPGradientContext", "gradient_toolbox", sp_gradient_toolbox_new, 0, 0,
SP_VERB_INVALID, 0, 0},
" <toolitem action='OffsetAction' />"
" <toolitem action='PaintbucketUnitsAction' />"
" </toolbar>"
+
+ " <toolbar name='DropperToolbar'>"
+ " <toolitem action='DropperPickAlphaAction' />"
+ " <toolitem action='DropperSetAlphaAction' />"
+ " </toolbar>"
"</ui>"
;
@@ -2910,100 +2915,24 @@ static void sp_arc_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions,
//## Dropper ##
//########################
-static void toggle_dropper_pick_alpha (GtkWidget *button, gpointer tbl) {
- prefs_set_int_attribute ("tools.dropper", "pick",
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)));
- GtkWidget *set_checkbox = (GtkWidget*) g_object_get_data(G_OBJECT(tbl), "set_checkbox");
- if (set_checkbox) {
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
- gtk_widget_set_sensitive (GTK_WIDGET (set_checkbox), TRUE);
+static void toggle_dropper_pick_alpha( GtkToggleAction* act, gpointer tbl ) {
+ prefs_set_int_attribute( "tools.dropper", "pick", gtk_toggle_action_get_active( act ) );
+ GtkAction* set_action = GTK_ACTION( g_object_get_data(G_OBJECT(tbl), "set_action") );
+ if ( set_action ) {
+ if ( gtk_toggle_action_get_active( act ) ) {
+ gtk_action_set_sensitive( set_action, TRUE );
} else {
- gtk_widget_set_sensitive (GTK_WIDGET (set_checkbox), FALSE);
+ gtk_action_set_sensitive( set_action, FALSE );
}
}
- spinbutton_defocus(GTK_OBJECT(tbl));
-}
-static void toggle_dropper_set_alpha (GtkWidget *button, gpointer tbl) {
- prefs_set_int_attribute ("tools.dropper", "setalpha",
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)) ? 1 : 0);
spinbutton_defocus(GTK_OBJECT(tbl));
}
-
-/**
- * Copy the current saved desktop color to the clipboard as full hex + alpha
- * color representation. This is useful for passing values between various
- * input boxes, or directly to xml.
- */
-/* static void
-sp_dropper_copy( GtkWidget *widget, GtkObject *obj)
-{
- GtkWidget *tbl = GTK_WIDGET(obj);
-
- SPDesktop *desktop =
- (SPDesktop *) gtk_object_get_data(GTK_OBJECT(tbl), "desktop");
-
-
- sp_dropper_c32_color_copy( sp_desktop_get_color(desktop, true) );
-}*/
-
-
-/**
- * Copies currently saved desktop color to the clipboard as a hex value. This
- * is useful for editing webpages and needing a value quickly for web
- * colors.
- *
- * TODO: When the toggle of the dropper is set to not mix color against
- * page background, this still just gets the color of the page and
- * doesn't get the actual mixed against background which is needed
- * for the hex value ppl. want for web pages, etc.
- */
-
-/* static void
-sp_dropper_copy_as_hex ( GtkWidget *widget, GtkObject *obj)
-{
- GtkWidget *tbl = GTK_WIDGET(obj);
-
- SPDesktop *desktop =
- (SPDesktop *) gtk_object_get_data(GTK_OBJECT(tbl), "desktop");
-
- sp_dropper_c32_color_copy_hex( sp_desktop_get_color(desktop, true) );
-}*/
-
-
-/**
- * Sets the input boxes with the changed color and opacity. This is used as a
- * callback for style changing.
- */
-/* static bool
-sp_style_changed (const SPCSSAttr *css, gpointer data)
-{
- // GrDrag *drag = (GrDrag *) data;
-
- // set fill of text entry box
- if (css->attribute("fill"))
- gtk_entry_set_text((GtkEntry *)dropper_rgb_entry,
- css->attribute("fill"));
-
- // set opacity of text entry box
- if (css->attribute("fill-opacity"))
- gtk_entry_set_text((GtkEntry *)dropper_opacity_entry,
- css->attribute("fill-opacity"));
-
- // set fill of text entry box
- if (css->attribute("stroke"))
- gtk_entry_set_text((GtkEntry *)dropper_rgb_entry,
- css->attribute("stroke"));
-
- // set opacity of text entry box
- if (css->attribute("stroke-opacity"))
- gtk_entry_set_text((GtkEntry *)dropper_opacity_entry,
- css->attribute("stroke-opacity"));
- return false;
-
+static void toggle_dropper_set_alpha( GtkToggleAction* act, gpointer tbl ) {
+ prefs_set_int_attribute( "tools.dropper", "setalpha", gtk_toggle_action_get_active( act ) ? 1 : 0 );
+ spinbutton_defocus(GTK_OBJECT(tbl));
}
-*/
/**
* TODO: Add queue of last 5 or so colors selected with new swatches so that
* can drag and drop places. Will provide a nice mixing palette.
*/
-static GtkWidget *
-sp_dropper_toolbox_new(SPDesktop *desktop)
+static void sp_dropper_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder)
{
- GtkWidget *tbl = gtk_hbox_new(FALSE, 0);
-
- gtk_object_set_data(GTK_OBJECT(tbl), "dtw", desktop->canvas);
- gtk_object_set_data(GTK_OBJECT(tbl), "desktop", desktop);
-
- GtkTooltips *tt = gtk_tooltips_new();
-
-
- gtk_box_pack_start(GTK_BOX(tbl), gtk_hbox_new(FALSE, 0), FALSE, FALSE,
- AUX_BETWEEN_BUTTON_GROUPS);
- // sp_toolbox_add_label(tbl, _("<b>New:</b>"));
-
-
-
- /* RGB Input Field */
- /* {
- GtkWidget *hb = gtk_hbox_new(FALSE, 1);
- GtkWidget *dropper_rgba_label = gtk_label_new ("Color:");
- gtk_widget_show (dropper_rgba_label);
- gtk_container_add(GTK_CONTAINER(hb), dropper_rgba_label);
-
- dropper_rgb_entry = gtk_entry_new ();
- sp_dialog_defocus_on_enter (dropper_rgb_entry);
- gtk_entry_set_max_length (GTK_ENTRY (dropper_rgb_entry), 7);
- gtk_entry_set_width_chars (GTK_ENTRY (dropper_rgb_entry), 7);
- gtk_tooltips_set_tip(tt, dropper_rgb_entry,
- _("Hexidecimal representation of last selected "
- "color"),
- NULL);
- gtk_widget_show (dropper_rgb_entry);
- gtk_container_add(GTK_CONTAINER(hb), dropper_rgb_entry);
-
- gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
- AUX_BETWEEN_BUTTON_GROUPS);
- } */
-
- /* Opacity Input Field */
-/* {
- GtkWidget *hb = gtk_hbox_new(FALSE, 1);
- GtkWidget *dropper_opacity_label = gtk_label_new ( _("Opacity:") );
- gtk_widget_show (dropper_opacity_label);
- gtk_container_add(GTK_CONTAINER(hb), dropper_opacity_label);
-
- dropper_opacity_entry = gtk_entry_new ();
- sp_dialog_defocus_on_enter (dropper_opacity_entry);
- gtk_entry_set_max_length (GTK_ENTRY (dropper_opacity_entry), 11);
- gtk_entry_set_width_chars (GTK_ENTRY (dropper_opacity_entry), 11);
- gtk_tooltips_set_tip(tt, dropper_opacity_entry,
- _("Opacity of last selected color"),
- NULL);
- gtk_widget_show (dropper_opacity_entry);
- gtk_container_add(GTK_CONTAINER(hb), dropper_opacity_entry);
-
- gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
- AUX_BETWEEN_BUTTON_GROUPS);
- } */
-
-
- /* Copy to Clipboard */
-/* {
- GtkWidget *hb = gtk_hbox_new(FALSE, 1);
- GtkWidget *b = gtk_button_new_with_label(_("Copy as RGBA"));
- gtk_tooltips_set_tip(tt, b, _("Copy last saved color as hexidecimal "
- "RGB + Alpha (RGBA) to "
- "clipboard"),
- NULL);
- gtk_widget_show(b);
- gtk_container_add(GTK_CONTAINER(hb), b);
- gtk_signal_connect(GTK_OBJECT(b), "clicked",
- GTK_SIGNAL_FUNC(sp_dropper_copy), tbl);
- gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
- AUX_BETWEEN_BUTTON_GROUPS);
- } */
-
-
- /* Copy to Clipboard as HEX */
-/* {
- GtkWidget *hb = gtk_hbox_new(FALSE, 1);
- GtkWidget *b = gtk_button_new_with_label(_("Copy as HEX"));
- gtk_tooltips_set_tip(tt, b, _("Copy last saved color as "
- "hexidecimal RGB without alpha "
- "to clipboard"), NULL);
- gtk_widget_show(b);
- gtk_container_add(GTK_CONTAINER(hb), b);
- gtk_signal_connect(GTK_OBJECT(b), "clicked",
- GTK_SIGNAL_FUNC(sp_dropper_copy_as_hex), tbl);
- gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
- AUX_BETWEEN_BUTTON_GROUPS);
- } */
-
- // aux_toolbox_space(tbl, AUX_BETWEEN_BUTTON_GROUPS);
+ gint pickAlpha = prefs_get_int_attribute( "tools.dropper", "pick", 1 );
{
- GtkWidget *hb = gtk_hbox_new(FALSE, 1);
-
- GtkWidget *button = gtk_check_button_new_with_label(_("Pick alpha"));
- gtk_tooltips_set_tip(tt, button, _("Pick both the color and the alpha (transparency) under cursor; otherwise, pick only the visible color premultiplied by alpha"), NULL);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
- prefs_get_int_attribute ("tools.dropper",
- "pick", 1));
- gtk_widget_show(button);
- gtk_container_add (GTK_CONTAINER (hb), button);
- gtk_object_set_data(GTK_OBJECT(tbl), "pick_checkbox", button);
- g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (toggle_dropper_pick_alpha), tbl);
- gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
- AUX_BETWEEN_BUTTON_GROUPS);
+ InkToggleAction* act = ink_toggle_action_new( "DropperPickAlphaAction",
+ _("Pick alpha"),
+ _("Pick both the color and the alpha (transparency) under cursor; otherwise, pick only the visible color premultiplied by alpha"),
+ "color_alpha_get",
+ Inkscape::ICON_SIZE_DECORATION );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
+ g_object_set_data( holder, "pick_action", act );
+ gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), pickAlpha );
+ g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_dropper_pick_alpha), holder );
}
{
- GtkWidget *hb = gtk_hbox_new(FALSE, 1);
-
- GtkWidget *button = gtk_check_button_new_with_label(_("Set alpha"));
- gtk_tooltips_set_tip(tt, button, _("If alpha was picked, assign it to selection as fill or stroke transparency"), NULL);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
- prefs_get_int_attribute ("tools.dropper",
- "setalpha", 1));
- gtk_widget_show(button);
- gtk_container_add (GTK_CONTAINER (hb), button);
- gtk_object_set_data(GTK_OBJECT(tbl), "set_checkbox", button);
- g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (toggle_dropper_set_alpha), tbl);
-
+ InkToggleAction* act = ink_toggle_action_new( "DropperSetAlphaAction",
+ _("Set alpha"),
+ _("If alpha was picked, assign it to selection as fill or stroke transparency"),
+ "color_alpha_set",
+ Inkscape::ICON_SIZE_DECORATION );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
+ g_object_set_data( holder, "set_action", act );
+ gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs_get_int_attribute( "tools.dropper", "setalpha", 1 ) );
// make sure it's disabled if we're not picking alpha
- GtkWidget *pick_checkbox = (GtkWidget*) g_object_get_data(G_OBJECT(tbl), "pick_checkbox");
- if (pick_checkbox) {
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pick_checkbox))) {
- gtk_widget_set_sensitive (GTK_WIDGET (button), TRUE);
- } else {
- gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE);
- }
- }
-
- gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
- AUX_BETWEEN_BUTTON_GROUPS);
+ gtk_action_set_sensitive( GTK_ACTION(act), pickAlpha );
+ g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_dropper_set_alpha), holder );
}
-
- aux_toolbox_space(tbl, AUX_BETWEEN_BUTTON_GROUPS);
-
-
- // where new gtkmm stuff should go
-
- gtk_widget_show_all(tbl);
- sp_set_font_size_smaller (tbl);
-
- /*
- sigc::connection *connection = new sigc::connection(
- desktop->connectSetStyle(
- sigc::bind(sigc::ptr_fun(sp_style_changed),
- desktop)) );
-
- g_signal_connect(G_OBJECT(tbl), "destroy", G_CALLBACK(delete_connection),
- connection); */
-
- return tbl;
}