[gimp/gimp-2-10] app: push a temporary status when picking layer with alt-midclick.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: push a temporary status when picking layer with alt-midclick.
- Date: Fri, 11 Jan 2019 12:20:20 +0000 (UTC)
commit 0055a2ad733515a64f2dca137b639d83628883de
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.
(cherry picked from commit 496bc02b491450a062abbd7a1ff7523a345bfbb7)
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 d203b06991..714f39f77f 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"
@@ -1241,9 +1243,7 @@ gimp_display_shell_canvas_tool_events_internal (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)
@@ -1327,6 +1327,17 @@ gimp_display_shell_canvas_tool_events_internal (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 &&
@@ -1581,7 +1592,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]