Commit 90893cea authored by Michael Natterer's avatar Michael Natterer 😴

Add "layers-merge-group" action, callback and menu items

parent 170054a3
......@@ -152,6 +152,12 @@ static const GimpActionEntry layers_actions[] =
G_CALLBACK (layers_merge_down_cmd_callback),
GIMP_HELP_LAYER_MERGE_DOWN },
{ "layers-merge-group", NULL,
NC_("layers-action", "Merge Layer Group"), NULL,
NC_("layers-action", "Merge the layer group's layers into one normal layer"),
G_CALLBACK (layers_merge_group_cmd_callback),
GIMP_HELP_LAYER_MERGE_GROUP },
{ "layers-merge-layers", NULL,
NC_("layers-action", "Merge _Visible Layers..."), NULL,
NC_("layers-action", "Merge all visible layers into one layer"),
......@@ -592,6 +598,9 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-anchor", layer && fs && !ac);
SET_SENSITIVE ("layers-merge-down", layer && !fs && !ac &&
!children && next_visible);
SET_VISIBLE ("layers-merge-group", children);
SET_SENSITIVE ("layers-merge-group", layer && !fs && !ac &&
children);
SET_SENSITIVE ("layers-merge-layers", layer && !fs && !ac);
SET_SENSITIVE ("layers-flatten-image", layer && !fs && !ac);
......
......@@ -505,6 +505,18 @@ layers_merge_down_cmd_callback (GtkAction *action,
gimp_image_flush (image);
}
void
layers_merge_group_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
gimp_image_merge_group_layer (image, GIMP_GROUP_LAYER (layer));
gimp_image_flush (image);
}
void
layers_delete_cmd_callback (GtkAction *action,
gpointer data)
......
......@@ -53,6 +53,8 @@ void layers_anchor_cmd_callback (GtkAction *action,
gpointer data);
void layers_merge_down_cmd_callback (GtkAction *action,
gpointer data);
void layers_merge_group_cmd_callback (GtkAction *action,
gpointer data);
void layers_delete_cmd_callback (GtkAction *action,
gpointer data);
void layers_text_discard_cmd_callback (GtkAction *action,
......
......@@ -144,6 +144,7 @@
#define GIMP_HELP_LAYER_DUPLICATE "gimp-layer-duplicate"
#define GIMP_HELP_LAYER_ANCHOR "gimp-layer-anchor"
#define GIMP_HELP_LAYER_MERGE_DOWN "gimp-layer-merge-down"
#define GIMP_HELP_LAYER_MERGE_GROUP "gimp-layer-merge-group"
#define GIMP_HELP_LAYER_DELETE "gimp-layer-delete"
#define GIMP_HELP_LAYER_TEXT_DISCARD "gimp-layer-text-discard"
#define GIMP_HELP_LAYER_TEXT_TO_PATH "gimp-layer-text-to-path"
......
......@@ -365,6 +365,7 @@
<placeholder name="Structure">
<menuitem action="layers-anchor" />
<menuitem action="layers-merge-down" />
<menuitem action="layers-merge-group" />
<menuitem action="layers-delete" />
</placeholder>
<separator />
......
......@@ -18,6 +18,7 @@
<menuitem action="layers-duplicate" />
<menuitem action="layers-anchor" />
<menuitem action="layers-merge-down" />
<menuitem action="layers-merge-group" />
<menuitem action="layers-delete" />
<separator />
<menuitem action="layers-text-discard" />
......
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