[gimp] app: consolidate UI for merging down and anchoring layers (issue #1184)



commit f539fc78c070b1da6511e8acd16cca559a8412a1
Author: woob <thetoastcaper gmail com>
Date:   Thu Dec 19 16:08:01 2019 -0500

    app: consolidate UI for merging down and anchoring layers (issue #1184)
    
    As they are both mutually exclusive and serve an almost identical
    purpose, the "Merge down" and "Anchor Layer" are given mutually
    exclusive visibility in menus, and the anchor button is replaced
    with a merge down button in the Layers dockable whenever there is
    no active floating selection

 app/actions/layers-actions.c    |  3 ++-
 app/widgets/gimplayertreeview.c | 10 +++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/app/actions/layers-actions.c b/app/actions/layers-actions.c
index aaf4dcac87..86a3c7c18b 100644
--- a/app/actions/layers-actions.c
+++ b/app/actions/layers-actions.c
@@ -937,7 +937,8 @@ layers_actions_update (GimpActionGroup *group,
   SET_SENSITIVE ("layers-lower",            layer && !fs && !ac && next);
   SET_SENSITIVE ("layers-lower-to-bottom",  layer && !fs && !ac && next);
 
-  SET_SENSITIVE ("layers-anchor",           layer &&  fs && !ac);
+  SET_VISIBLE   ("layers-anchor",           layer &&  fs && !ac);
+  SET_VISIBLE   ("layers-merge-down",       !fs);
   SET_SENSITIVE ("layers-merge-down",       layer && !fs && !ac && visible && next_visible);
   SET_VISIBLE   ("layers-merge-group",      children);
   SET_SENSITIVE ("layers-merge-group",      layer && !fs && !ac && children);
diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c
index f779ccf0a5..45f5c4fa1c 100644
--- a/app/widgets/gimplayertreeview.c
+++ b/app/widgets/gimplayertreeview.c
@@ -388,6 +388,14 @@ gimp_layer_tree_view_constructed (GObject *object)
   gtk_box_reorder_child (gimp_editor_get_button_box (GIMP_EDITOR (layer_view)),
                          button, 5);
 
+  button = gimp_editor_add_action_button (GIMP_EDITOR (layer_view), "layers",
+                                          "layers-merge-down", NULL);
+  gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (layer_view),
+                                  GTK_BUTTON (button),
+                                  GIMP_TYPE_LAYER);
+  gtk_box_reorder_child (gimp_editor_get_button_box (GIMP_EDITOR (layer_view)),
+                         button, 6);
+
   button = gimp_editor_add_action_button (GIMP_EDITOR (layer_view), "layers",
                                           "layers-mask-add-button",
                                           "layers-mask-add-last-values",
@@ -402,7 +410,7 @@ gimp_layer_tree_view_constructed (GObject *object)
                                   GTK_BUTTON (button),
                                   GIMP_TYPE_LAYER);
   gtk_box_reorder_child (gimp_editor_get_button_box (GIMP_EDITOR (layer_view)),
-                         button, 6);
+                         button, 7);
 }
 
 static void


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