[gimp] app: push a temporary status when picking layer with alt-midclick.



commit 496bc02b491450a062abbd7a1ff7523a345bfbb7
Author: Jehan <jehan girinstud io>
Date:   Wed Jan 9 00:11:37 2019 +0100

    app: push a temporary status when picking layer with alt-midclick.
    
    Though the layer list will also show updated, it is much easier to look
    at the layer name in the status bar whose position never changes.
    Anyway it makes sense to just show a temporary status info message
    giving the picked layer name, making it all the easier to find the layer
    you are looking for.

 app/display/gimpdisplayshell-tool-events.c | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-tool-events.c b/app/display/gimpdisplayshell-tool-events.c
index a12609e405..f1e0a0e2df 100644
--- a/app/display/gimpdisplayshell-tool-events.c
+++ b/app/display/gimpdisplayshell-tool-events.c
@@ -67,7 +67,9 @@
 #include "gimpdisplayshell-transform.h"
 #include "gimpimagewindow.h"
 #include "gimpmotionbuffer.h"
+#include "gimpstatusbar.h"
 
+#include "gimp-intl.h"
 #include "gimp-log.h"
 
 
@@ -993,9 +995,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget        *canvas,
               }
 
             if (gimp_display_shell_key_to_state (kevent->keyval) == GDK_MOD1_MASK)
-              /* We reset the picked layer only when hitting the Alt
-               * key.
-               */
+              /* Make sure the picked layer is reset. */
               shell->picked_layer = NULL;
 
             switch (kevent->keyval)
@@ -1079,6 +1079,17 @@ gimp_display_shell_canvas_tool_events (GtkWidget        *canvas,
 
         active_tool = tool_manager_get_active (gimp);
 
+        if (gimp_display_shell_key_to_state (kevent->keyval) == GDK_MOD1_MASK &&
+            shell->picked_layer)
+          {
+            GimpStatusbar *statusbar;
+
+            statusbar = gimp_display_shell_get_statusbar (shell);
+            gimp_statusbar_pop_temp (statusbar);
+
+            shell->picked_layer = NULL;
+          }
+
         if ((state & GDK_BUTTON1_MASK)      &&
             (! shell->space_release_pending ||
              (kevent->keyval != GDK_KEY_space &&
@@ -1544,7 +1555,17 @@ gimp_display_shell_start_scrolling (GimpDisplayShell *shell,
       if (layer && ! gimp_image_get_floating_selection (image))
         {
           if (layer != gimp_image_get_active_layer (image))
-            gimp_image_set_active_layer (image, layer);
+            {
+              GimpStatusbar *statusbar;
+
+              gimp_image_set_active_layer (image, layer);
+
+              statusbar = gimp_display_shell_get_statusbar (shell);
+              gimp_statusbar_push_temp (statusbar, GIMP_MESSAGE_INFO,
+                                        GIMP_ICON_LAYER,
+                                        _("Layer picked: '%s'"),
+                                        gimp_object_get_name (layer));
+            }
           shell->picked_layer = layer;
         }
     }


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