summaryrefslogtreecommitdiffstats
path: root/src/widgets/toolbox.cpp
diff options
context:
space:
mode:
authorJohn Bintz <me@johnbintz.com>2007-02-27 23:28:03 +0000
committerjohncoswell <johncoswell@users.sourceforge.net>2007-02-27 23:28:03 +0000
commit570b803bd2d3194f38a1e89a25b117eb707b2c1f (patch)
tree0fb4d66ddd63fc4f06bb891d34222a509d128ce2 /src/widgets/toolbox.cpp
parentget rid of sp_repr_document_root and (commented) sp_repr_duplicate (diff)
downloadinkscape-570b803bd2d3194f38a1e89a25b117eb707b2c1f.tar.gz
inkscape-570b803bd2d3194f38a1e89a25b117eb707b2c1f.zip
Add paint bucket tolerance setting and toolbar widget to control tolerance
(bzr r2462)
Diffstat (limited to 'src/widgets/toolbox.cpp')
-rw-r--r--src/widgets/toolbox.cpp18
1 files changed, 18 insertions, 0 deletions
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);