[gnome-builder] app: allow showing command bar from anywhere



commit 33541b1d2a2ae51da03426986fa9cd2b9374aec8
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Tue Feb 2 18:30:50 2016 +0100

    app: allow showing command bar from anywhere
    
    we add <control>Return and <ctrl>Enter
    at the appliction level so that we can
    show the command bar even from Terminal plugin
    and entries
    
    thid is especially needed in Vim mode where using
    <shift>: writes : in Terminal and entries

 data/keybindings/default.css     |    3 ---
 libide/ide-application-actions.c |    2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/data/keybindings/default.css b/data/keybindings/default.css
index 3a2aee1..3e2d82a 100644
--- a/data/keybindings/default.css
+++ b/data/keybindings/default.css
@@ -47,9 +47,6 @@
   bind "<alt>n" { "move-error" (down) };
   bind "<alt>p" { "move-error" (up) };
 
-  bind "<ctrl>Return" { "action" ("win", "show-command-bar", "") };
-  bind "<ctrl>KP_Enter" { "action" ("win", "show-command-bar", "") };
-
   bind "<ctrl>g" { "move-search" (down, 0, 1, 1, 1, 1) };
   bind "<ctrl><shift>g" { "move-search" (up, 0, 1, 0, 1, 1) };
   bind "<ctrl><shift>k" { "clear-search" () };
diff --git a/libide/ide-application-actions.c b/libide/ide-application-actions.c
index be9ca66..6f92ab6 100644
--- a/libide/ide-application-actions.c
+++ b/libide/ide-application-actions.c
@@ -301,6 +301,7 @@ ide_application_actions_init (IdeApplication *self)
   static const gchar *new_file[] = { "<control>n", NULL };
   static const gchar *shortcuts[] = { "<control>F1", "<control><shift>question", NULL };
   static const gchar *help[] = { "F1", NULL };
+  static const gchar *command_bar[] = { "<ctrl>Return", "<ctrl>KP_Enter", NULL };
 
   g_action_map_add_action_entries (G_ACTION_MAP (self), IdeApplicationActions,
                                    G_N_ELEMENTS (IdeApplicationActions), self);
@@ -316,4 +317,5 @@ ide_application_actions_init (IdeApplication *self)
   gtk_application_set_accels_for_action (GTK_APPLICATION (self), "perspective.new-file", new_file);
   gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.shortcuts", shortcuts);
   gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.help", help);
+  gtk_application_set_accels_for_action (GTK_APPLICATION (self), "win.show-command-bar", command_bar);
 }


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