Commit b2606b51 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

Re-enabled filling the whole selection using the bucket fill tool. Fixes

2004-01-27  Michael Natterer  <mitch@gimp.org>

	Re-enabled filling the whole selection using the bucket fill
	tool. Fixes bug #132649.

	* app/tools/gimpbucketfilloptions.[ch]: added boolean property
	"fill-selection" and a GUI for it.

	* app/tools/gimpbucketfilltool.c: changed accordingly.
parent 1d71eaa1
2004-01-27 Michael Natterer <mitch@gimp.org>
Re-enabled filling the whole selection using the bucket fill
tool. Fixes bug #132649.
* app/tools/gimpbucketfilloptions.[ch]: added boolean property
"fill-selection" and a GUI for it.
* app/tools/gimpbucketfilltool.c: changed accordingly.
2004-01-27 Michael Natterer <mitch@gimp.org>
 
* app/gui/image-menu.c (image_menu_entries)
......@@ -45,10 +45,11 @@
enum
{
PROP_0,
PROP_FILL_MODE,
PROP_FILL_SELECTION,
PROP_FILL_TRANSPARENT,
PROP_SAMPLE_MERGED,
PROP_THRESHOLD,
PROP_FILL_MODE
PROP_THRESHOLD
};
......@@ -66,6 +67,9 @@ static void gimp_bucket_fill_options_get_property (GObject *object,
static void gimp_bucket_fill_options_reset (GimpToolOptions *tool_options);
static void gimp_bucket_fill_options_set_defaults (GimpToolOptions *tool_options);
static void gimp_bucket_fill_options_notify (GimpBucketFillOptions *options,
GParamSpec *pspec,
GtkWidget *widget);
static GimpPaintOptionsClass *parent_class = NULL;
......@@ -115,6 +119,15 @@ gimp_bucket_fill_options_class_init (GimpBucketFillOptionsClass *klass)
options_class->reset = gimp_bucket_fill_options_reset;
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_FILL_MODE,
"fill-mode", NULL,
GIMP_TYPE_BUCKET_FILL_MODE,
GIMP_FG_BUCKET_FILL,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_FILL_SELECTION,
"fill-selection", NULL,
FALSE,
0);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_FILL_TRANSPARENT,
"fill-transparent",
N_("Allow completely transparent regions "
......@@ -132,11 +145,6 @@ gimp_bucket_fill_options_class_init (GimpBucketFillOptionsClass *klass)
N_("Maximum color difference"),
0.0, 255.0, 15.0,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_FILL_MODE,
"fill-mode", NULL,
GIMP_TYPE_BUCKET_FILL_MODE,
GIMP_FG_BUCKET_FILL,
0);
}
static void
......@@ -156,6 +164,12 @@ gimp_bucket_fill_options_set_property (GObject *object,
switch (property_id)
{
case PROP_FILL_MODE:
options->fill_mode = g_value_get_enum (value);
break;
case PROP_FILL_SELECTION:
options->fill_selection = g_value_get_boolean (value);
break;
case PROP_FILL_TRANSPARENT:
options->fill_transparent = g_value_get_boolean (value);
break;
......@@ -165,9 +179,6 @@ gimp_bucket_fill_options_set_property (GObject *object,
case PROP_THRESHOLD:
options->threshold = g_value_get_double (value);
break;
case PROP_FILL_MODE:
options->fill_mode = g_value_get_enum (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -186,6 +197,12 @@ gimp_bucket_fill_options_get_property (GObject *object,
switch (property_id)
{
case PROP_FILL_MODE:
g_value_set_enum (value, options->fill_mode);
break;
case PROP_FILL_SELECTION:
g_value_set_boolean (value, options->fill_selection);
break;
case PROP_FILL_TRANSPARENT:
g_value_set_boolean (value, options->fill_transparent);
break;
......@@ -195,9 +212,6 @@ gimp_bucket_fill_options_get_property (GObject *object,
case PROP_THRESHOLD:
g_value_set_double (value, options->threshold);
break;
case PROP_FILL_MODE:
g_value_set_enum (value, options->fill_mode);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -248,10 +262,26 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
/* fill selection */
str = g_strdup_printf (_("Affected Area %s"), gimp_get_mod_name_shift ());
frame = gimp_prop_boolean_radio_frame_new (config, "fill-selection",
str,
_("Fill Whole Selection"),
_("Fill Similar Colors"));
g_free (str);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
frame = gtk_frame_new (_("Finding Similar Colors"));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
gtk_widget_set_sensitive (frame, ! GIMP_BUCKET_FILL_OPTIONS (config)->fill_selection);
g_signal_connect_object (config, "notify::fill-selection",
G_CALLBACK (gimp_bucket_fill_options_notify),
G_OBJECT (frame), 0);
vbox2 = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2);
gtk_container_add (GTK_CONTAINER (frame), vbox2);
......@@ -285,3 +315,11 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
return vbox;
}
static void
gimp_bucket_fill_options_notify (GimpBucketFillOptions *options,
GParamSpec *pspec,
GtkWidget *widget)
{
gtk_widget_set_sensitive (widget, ! options->fill_selection);
}
......@@ -38,10 +38,11 @@ struct _GimpBucketFillOptions
{
GimpPaintOptions paint_options;
GimpBucketFillMode fill_mode;
gboolean fill_selection;
gboolean fill_transparent;
gboolean sample_merged;
gdouble threshold;
GimpBucketFillMode fill_mode;
};
......
......@@ -205,7 +205,7 @@ gimp_bucket_fill_tool_button_release (GimpTool *tool,
options->fill_mode,
gimp_context_get_paint_mode (context),
gimp_context_get_opacity (context),
TRUE, /* do seed fill */
! options->fill_selection,
options->fill_transparent,
options->threshold,
options->sample_merged,
......@@ -245,6 +245,10 @@ gimp_bucket_fill_tool_modifier_key (GimpTool *tool,
break;
}
}
else if (key == GDK_SHIFT_MASK)
{
g_object_set (options, "fill-selection", ! options->fill_selection, NULL);
}
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment