diff options
| author | John Bintz <me@johnbintz.com> | 2007-03-08 02:35:11 +0000 |
|---|---|---|
| committer | johncoswell <johncoswell@users.sourceforge.net> | 2007-03-08 02:35:11 +0000 |
| commit | 8d5da277b1738cd3f6eb5edc33f2609fcdcb2dfc (patch) | |
| tree | 72e9d6c885e6e4c8e732961d45f5e8a873ba09e6 /src/widgets | |
| parent | Fix what appears to be a copy&paste bug: ć was getting rendered as ˇc; chan... (diff) | |
| download | inkscape-8d5da277b1738cd3f6eb5edc33f2609fcdcb2dfc.tar.gz inkscape-8d5da277b1738cd3f6eb5edc33f2609fcdcb2dfc.zip | |
Add units selector to offset and remove offset range limits
(bzr r2564)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/toolbox.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index fe6e6f676..975a8cbda 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -4442,7 +4442,10 @@ static void paintbucket_tolerance_changed(GtkAdjustment *adj, GtkWidget *tbl) static void paintbucket_offset_changed(GtkAdjustment *adj, GtkWidget *tbl) { - prefs_set_double_attribute("tools.paintbucket", "offset", (gint)adj->value); + GtkWidget *us = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(tbl), "units"); + SPUnit const *unit = sp_unit_selector_get_unit(SP_UNIT_SELECTOR(us)); + + prefs_set_double_attribute("tools.paintbucket", "offset", (gdouble)sp_units_get_pixels(adj->value, *unit)); spinbutton_defocus(GTK_OBJECT(tbl)); } @@ -4466,16 +4469,24 @@ sp_paintbucket_toolbox_new(SPDesktop *desktop) // interval gtk_box_pack_start(GTK_BOX(tbl), gtk_hbox_new(FALSE, 0), FALSE, FALSE, AUX_BETWEEN_BUTTON_GROUPS); + // Create the units menu. + GtkWidget *us = sp_unit_selector_new(SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE); + sp_unit_selector_setsize(us, AUX_OPTION_MENU_WIDTH, AUX_OPTION_MENU_HEIGHT); + sp_unit_selector_set_unit (SP_UNIT_SELECTOR(us), sp_desktop_namedview(desktop)->doc_units); + // Offset spinbox { GtkWidget *offset = sp_tb_spinbutton(_("Offset:"), _("The amount to grow the path after it has been traced"), - "tools.paintbucket", "offset", 5, NULL, tbl, TRUE, - "inkscape:paintbucket-offset", 0.0, 2.0, 0.1, 0.5, + "tools.paintbucket", "offset", 5, us, tbl, TRUE, + "inkscape:paintbucket-offset", -1e6, 1e6, 0.1, 0.5, paintbucket_offset_changed, 1, 2); gtk_box_pack_start(GTK_BOX(tbl), offset, FALSE, FALSE, AUX_SPACING); + + gtk_box_pack_start(GTK_BOX(tbl), us, FALSE, FALSE, AUX_SPACING); + gtk_object_set_data(GTK_OBJECT(tbl), "units", us); } // interval |
