[gimp] app: more accurate undo names.



commit 081ebf19f02aa6461606d73e44dd712a1ee4b6f7
Author: Jehan <jehan girinstud io>
Date:   Wed May 20 21:18:20 2020 +0200

    app: more accurate undo names.
    
    Don't just name all alpha-selection actions the same "Alpha to
    Selection". Have some more accurate naming like "Substract Alpha from
    Selection", etc.
    
    Also improve the action names to make them more accurate as these names
    are not only in menus anymore, but also in search actions (and we want
    to avoid duplicate naming).

 app/actions/layers-actions.c  |  6 +++---
 app/actions/layers-commands.c | 21 +++++++++++++++++++--
 2 files changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/app/actions/layers-actions.c b/app/actions/layers-actions.c
index f1ef10a145..0424215e23 100644
--- a/app/actions/layers-actions.c
+++ b/app/actions/layers-actions.c
@@ -534,21 +534,21 @@ static const GimpEnumActionEntry layers_alpha_to_selection_actions[] =
     GIMP_HELP_LAYER_ALPHA_SELECTION_REPLACE },
 
   { "layers-alpha-selection-add", GIMP_ICON_SELECTION_ADD,
-    NC_("layers-action", "A_dd to Selection"), NULL,
+    NC_("layers-action", "A_dd Alpha to Selection"), NULL,
     NC_("layers-action",
         "Add the layer's alpha channel to the current selection"),
     GIMP_CHANNEL_OP_ADD, FALSE,
     GIMP_HELP_LAYER_ALPHA_SELECTION_ADD },
 
   { "layers-alpha-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
-    NC_("layers-action", "_Subtract from Selection"), NULL,
+    NC_("layers-action", "_Subtract Alpha from Selection"), NULL,
     NC_("layers-action",
         "Subtract the layer's alpha channel from the current selection"),
     GIMP_CHANNEL_OP_SUBTRACT, FALSE,
     GIMP_HELP_LAYER_ALPHA_SELECTION_SUBTRACT },
 
   { "layers-alpha-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
-    NC_("layers-action", "_Intersect with Selection"), NULL,
+    NC_("layers-action", "_Intersect Alpha with Selection"), NULL,
     NC_("layers-action",
         "Intersect the layer's alpha channel with the current selection"),
     GIMP_CHANNEL_OP_INTERSECT, FALSE,
diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c
index 6b8be0922f..4cce3f5c61 100644
--- a/app/actions/layers-commands.c
+++ b/app/actions/layers-commands.c
@@ -1562,8 +1562,25 @@ layers_alpha_to_selection_cmd_callback (GimpAction *action,
 
   operation = (GimpChannelOps) g_variant_get_int32 (value);
 
-  gimp_channel_push_undo (gimp_image_get_mask (image),
-                          C_("undo-type", "Alpha to Selection"));
+  switch (operation)
+    {
+    case GIMP_CHANNEL_OP_REPLACE:
+      gimp_channel_push_undo (gimp_image_get_mask (image),
+                              C_("undo-type", "Alpha to Selection"));
+      break;
+    case GIMP_CHANNEL_OP_ADD:
+      gimp_channel_push_undo (gimp_image_get_mask (image),
+                              C_("undo-type", "Add Alpha to Selection"));
+      break;
+    case GIMP_CHANNEL_OP_SUBTRACT:
+      gimp_channel_push_undo (gimp_image_get_mask (image),
+                              C_("undo-type", "Subtract Alpha from Selection"));
+      break;
+    case GIMP_CHANNEL_OP_INTERSECT:
+      gimp_channel_push_undo (gimp_image_get_mask (image),
+                              C_("undo-type", "Intersect Alpha with Selection"));
+      break;
+    }
   gimp_channel_combine_items (gimp_image_get_mask (image),
                               layers, operation);
   gimp_image_flush (image);


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