[gimp] app: layers-text-tool should give the focus to the canvas.



commit bb977263ca285e93501ce703ac9bb70433f696df
Author: Jehan <jehan girinstud io>
Date:   Sat May 13 00:55:43 2017 +0200

    app: layers-text-tool should give the focus to the canvas.
    
    If focus is on the layer list for instance, running this action from
    right-click menu raises the on-canvas toolbar, ready for edition, with a
    visible text cursor. But if the canvas has no focus (since you clicked
    on the layer list, it has the focus), you still have to move your mouse
    over and click the text on canvas. That doesn't make sense and there
    would be barely any reason to use this over selecting the text tool then
    clicking the canvas.

 app/actions/layers-commands.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c
index d1f40a8..10c6acc 100644
--- a/app/actions/layers-commands.c
+++ b/app/actions/layers-commands.c
@@ -203,7 +203,14 @@ layers_text_tool_cmd_callback (GtkAction *action,
     }
 
   if (GIMP_IS_TEXT_TOOL (active_tool))
-    gimp_text_tool_set_layer (GIMP_TEXT_TOOL (active_tool), layer);
+    {
+      GimpDisplayShell *shell;
+
+      gimp_text_tool_set_layer (GIMP_TEXT_TOOL (active_tool), layer);
+
+      shell = gimp_display_get_shell (active_tool->display);
+      gtk_widget_grab_focus (shell->canvas);
+    }
 }
 
 void


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