From 570b803bd2d3194f38a1e89a25b117eb707b2c1f Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 27 Feb 2007 23:28:03 +0000 Subject: Add paint bucket tolerance setting and toolbar widget to control tolerance (bzr r2462) --- src/widgets/toolbox.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 43ebb6b5d..788176d9c 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -4432,11 +4432,29 @@ sp_connector_toolbox_new(SPDesktop *desktop) } // end of sp_connector_toolbox_new() +static void paintbucket_tolerance_changed(GtkAdjustment *adj, GtkWidget *tbl) +{ + prefs_set_int_attribute("tools.paintbucket", "tolerance", (gint)adj->value); + spinbutton_defocus(GTK_OBJECT(tbl)); +} + static GtkWidget * sp_paintbucket_toolbox_new(SPDesktop *desktop) { GtkWidget *tbl = gtk_hbox_new(FALSE, 0); + // Spacing spinbox + { + GtkWidget *tolerance = sp_tb_spinbutton(_("Tolerance:"), + _("The maximum allowed difference between the clicked pixel and the neighboring pixels to be counted in the fill"), + "tools.paintbucket", "tolerance", 8, NULL, tbl, TRUE, + "inkscape:paintbucket-tolerance", 0, 255, 1.0, 10.0, + paintbucket_tolerance_changed, 1, 0); + + gtk_box_pack_start(GTK_BOX(tbl), tolerance, FALSE, FALSE, + AUX_SPACING); + } + Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of Paint Bucket fill objects")); swatch->setDesktop (desktop); swatch->setClickVerb (SP_VERB_CONTEXT_PAINTBUCKET_PREFS); -- cgit v1.2.3