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.
This commit is contained in:
Jehan
2019-01-09 00:11:37 +01:00
parent 5c20d220dd
commit 496bc02b49

View File

@ -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;
}
}