Skip to content

Commit

Permalink
app: push a temporary status when picking layer with alt-midclick.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jehan committed Jan 8, 2019
1 parent 5c20d22 commit 496bc02
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions app/display/gimpdisplayshell-tool-events.c
Expand Up @@ -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"


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 &&
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 496bc02

Please sign in to comment.