[gimp] Bug 435540 - layer tab: context menu on floating selection



commit 317e095052cbea043bf7a739b529134f9859f784
Author: Michael Natterer <mitch gimp org>
Date:   Mon Mar 15 12:13:05 2010 +0100

    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.

 app/actions/layers-actions.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/app/actions/layers-actions.c b/app/actions/layers-actions.c
index 40fa049..a277a22 100644
--- a/app/actions/layers-actions.c
+++ b/app/actions/layers-actions.c
@@ -26,6 +26,7 @@
 
 #include "core/gimpimage.h"
 #include "core/gimplayer.h"
+#include "core/gimplayer-floating-sel.h"
 #include "core/gimplayermask.h"
 
 #include "text/gimptextlayer.h"
@@ -574,10 +575,23 @@ layers_actions_update (GimpActionGroup *group,
         gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
 #define SET_ACTIVE(action,condition) \
         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_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-last-values",  image);
   SET_SENSITIVE ("layers-new-from-visible", image);
@@ -647,4 +661,5 @@ layers_actions_update (GimpActionGroup *group,
 #undef SET_VISIBLE
 #undef SET_SENSITIVE
 #undef SET_ACTIVE
+#undef SET_LABEL
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]