Commit 317e0950 authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

Bug 435540 - layer tab: context menu on floating selection

Say "To New Layer" in the menu item if the active layer is the
floating selection.
parent 44a5a34d
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimplayer.h" #include "core/gimplayer.h"
#include "core/gimplayer-floating-sel.h"
#include "core/gimplayermask.h" #include "core/gimplayermask.h"
#include "text/gimptextlayer.h" #include "text/gimptextlayer.h"
...@@ -574,10 +575,23 @@ layers_actions_update (GimpActionGroup *group, ...@@ -574,10 +575,23 @@ layers_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_sensitive (group, action, (condition) != 0) gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
#define SET_ACTIVE(action,condition) \ #define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0) gimp_action_group_set_action_active (group, action, (condition) != 0)
#define SET_LABEL(action,label) \
gimp_action_group_set_action_label (group, action, label)
SET_VISIBLE ("layers-text-tool", text_layer && !ac); SET_VISIBLE ("layers-text-tool", text_layer && !ac);
SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac); SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac);
if (layer && gimp_layer_is_floating_sel (layer))
{
SET_LABEL ("layers-new", "To _New Layer");
SET_LABEL ("layers-new-last-values", "To _New Layer");
}
else
{
SET_LABEL ("layers-new", "_New Layer...");
SET_LABEL ("layers-new-last-values", "_New Layer");
}
SET_SENSITIVE ("layers-new", image); SET_SENSITIVE ("layers-new", image);
SET_SENSITIVE ("layers-new-last-values", image); SET_SENSITIVE ("layers-new-last-values", image);
SET_SENSITIVE ("layers-new-from-visible", image); SET_SENSITIVE ("layers-new-from-visible", image);
...@@ -647,4 +661,5 @@ layers_actions_update (GimpActionGroup *group, ...@@ -647,4 +661,5 @@ layers_actions_update (GimpActionGroup *group,
#undef SET_VISIBLE #undef SET_VISIBLE
#undef SET_SENSITIVE #undef SET_SENSITIVE
#undef SET_ACTIVE #undef SET_ACTIVE
#undef SET_LABEL
} }
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