diff --git a/app/actions/select-actions.c b/app/actions/select-actions.c
index c1ba5d8be0..02af2afa65 100644
--- a/app/actions/select-actions.c
+++ b/app/actions/select-actions.c
@@ -101,6 +101,12 @@ static const GimpActionEntry select_actions[] =
G_CALLBACK (select_border_cmd_callback),
GIMP_HELP_SELECTION_BORDER },
+ { "select-flood", NULL,
+ NC_("select-action", "F_lood"), NULL,
+ NC_("select-action", "Level the selection's interior"),
+ G_CALLBACK (select_flood_cmd_callback),
+ GIMP_HELP_SELECTION_FLOOD },
+
{ "select-save", GIMP_STOCK_SELECTION_TO_CHANNEL,
NC_("select-action", "Save to _Channel"), NULL,
NC_("select-action", "Save the selection to a channel"),
@@ -169,6 +175,7 @@ select_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("select-shrink", drawable && sel);
SET_SENSITIVE ("select-grow", drawable && sel);
SET_SENSITIVE ("select-border", drawable && sel);
+ SET_SENSITIVE ("select-flood", drawable && sel);
SET_SENSITIVE ("select-save", drawable && !fs);
SET_SENSITIVE ("select-stroke", writable && !children && sel);
diff --git a/app/actions/select-commands.c b/app/actions/select-commands.c
index e9999df36b..6f9aef8ff9 100644
--- a/app/actions/select-commands.c
+++ b/app/actions/select-commands.c
@@ -307,6 +307,17 @@ select_border_cmd_callback (GtkAction *action,
gtk_widget_show (dialog);
}
+void
+select_flood_cmd_callback (GtkAction *action,
+ gpointer data)
+{
+ GimpImage *image;
+ return_if_no_image (image, data);
+
+ gimp_channel_flood (gimp_image_get_mask (image), TRUE);
+ gimp_image_flush (image);
+}
+
void
select_save_cmd_callback (GtkAction *action,
gpointer data)
diff --git a/app/actions/select-commands.h b/app/actions/select-commands.h
index f70307c785..f34bc7f590 100644
--- a/app/actions/select-commands.h
+++ b/app/actions/select-commands.h
@@ -37,6 +37,8 @@ void select_border_cmd_callback (GtkAction *action,
gpointer data);
void select_grow_cmd_callback (GtkAction *action,
gpointer data);
+void select_flood_cmd_callback (GtkAction *action,
+ gpointer data);
void select_save_cmd_callback (GtkAction *action,
gpointer data);
void select_stroke_cmd_callback (GtkAction *action,
diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c
index dc2a375889..669f2fd6e9 100644
--- a/app/core/gimpselection.c
+++ b/app/core/gimpselection.c
@@ -131,6 +131,8 @@ static void gimp_selection_shrink (GimpChannel *channel,
gint radius_y,
gboolean edge_lock,
gboolean push_undo);
+static void gimp_selection_flood (GimpChannel *channel,
+ gboolean push_undo);
G_DEFINE_TYPE (GimpSelection, gimp_selection, GIMP_TYPE_CHANNEL)
@@ -173,6 +175,7 @@ gimp_selection_class_init (GimpSelectionClass *klass)
channel_class->border = gimp_selection_border;
channel_class->grow = gimp_selection_grow;
channel_class->shrink = gimp_selection_shrink;
+ channel_class->flood = gimp_selection_flood;
channel_class->feather_desc = C_("undo-type", "Feather Selection");
channel_class->sharpen_desc = C_("undo-type", "Sharpen Selection");
@@ -182,6 +185,7 @@ gimp_selection_class_init (GimpSelectionClass *klass)
channel_class->border_desc = C_("undo-type", "Border Selection");
channel_class->grow_desc = C_("undo-type", "Grow Selection");
channel_class->shrink_desc = C_("undo-type", "Shrink Selection");
+ channel_class->flood_desc = C_("undo-type", "Flood Selection");
}
static void
@@ -533,6 +537,13 @@ gimp_selection_shrink (GimpChannel *channel,
push_undo);
}
+static void
+gimp_selection_flood (GimpChannel *channel,
+ gboolean push_undo)
+{
+ GIMP_CHANNEL_CLASS (parent_class)->flood (channel, push_undo);
+}
+
/* public functions */
diff --git a/app/widgets/gimphelp-ids.h b/app/widgets/gimphelp-ids.h
index 796e70f11e..1daccbff93 100644
--- a/app/widgets/gimphelp-ids.h
+++ b/app/widgets/gimphelp-ids.h
@@ -74,6 +74,7 @@
#define GIMP_HELP_SELECTION_SHRINK "gimp-selection-shrink"
#define GIMP_HELP_SELECTION_GROW "gimp-selection-grow"
#define GIMP_HELP_SELECTION_BORDER "gimp-selection-border"
+#define GIMP_HELP_SELECTION_FLOOD "gimp-selection-flood"
#define GIMP_HELP_SELECTION_STROKE "gimp-selection-stroke"
#define GIMP_HELP_SELECTION_TO_CHANNEL "gimp-selection-to-channel"
#define GIMP_HELP_SELECTION_TO_PATH "gimp-selection-to-path"
diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in
index 9200840648..037324c4b4 100644
--- a/menus/image-menu.xml.in
+++ b/menus/image-menu.xml.in
@@ -243,6 +243,7 @@
+
diff --git a/menus/selection-menu.xml b/menus/selection-menu.xml
index 3fb7e09854..2ef3ece3e5 100644
--- a/menus/selection-menu.xml
+++ b/menus/selection-menu.xml
@@ -15,6 +15,7 @@
+