[devhelp] accels: add support for ctrl-l to focus the search field



commit 29ca2a74f078f38fc4e3ea1530c83275c265dd1c
Author: Frédéric Péters <fpeters 0d be>
Date:   Mon Aug 10 07:15:02 2015 +0200

    accels: add support for ctrl-l to focus the search field

 src/dh-app.c    |   13 ++++++-------
 src/dh-window.c |    1 -
 2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/dh-app.c b/src/dh-app.c
index b2ef6db..c6c1aac 100644
--- a/src/dh-app.c
+++ b/src/dh-app.c
@@ -313,7 +313,7 @@ static GActionEntry app_entries[] = {
 static void
 setup_accelerators (DhApp *self)
 {
-        const gchar *accels[] = {NULL, NULL};
+        const gchar *accels[] = {NULL, NULL, NULL, NULL};
 
         accels[0] = "<Primary>0";
         gtk_application_set_accels_for_action (GTK_APPLICATION (self), "win.zoom-default", accels);
@@ -324,12 +324,6 @@ setup_accelerators (DhApp *self)
         accels[0] = "<Primary>plus";
         gtk_application_set_accels_for_action (GTK_APPLICATION (self), "win.zoom-in", accels);
 
-        accels[0] = "<Primary>k";
-        gtk_application_set_accels_for_action (GTK_APPLICATION (self), "win.focus-search", accels);
-
-        accels[0] = "<Primary>s";
-        gtk_application_set_accels_for_action (GTK_APPLICATION (self), "win.focus-search-alt", accels);
-
         accels[0] = "<Primary>f";
         gtk_application_set_accels_for_action (GTK_APPLICATION (self), "win.find", accels);
 
@@ -362,6 +356,11 @@ setup_accelerators (DhApp *self)
 
         accels[0] = "Back";
         gtk_application_set_accels_for_action (GTK_APPLICATION (self), "win.go-back", accels);
+
+        accels[0] = "<Primary>k";
+        accels[1] = "<Primary>s";
+        accels[2] = "<Primary>l";
+        gtk_application_set_accels_for_action (GTK_APPLICATION (self), "win.focus-search", accels);
 }
 
 /******************************************************************************/
diff --git a/src/dh-window.c b/src/dh-window.c
index d39aa32..82e2f52 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -480,7 +480,6 @@ static GActionEntry win_entries[] = {
         { "zoom-out",         zoom_out_cb,         NULL, NULL, NULL },
         { "zoom-default",     zoom_default_cb,     NULL, NULL, NULL },
         { "focus-search",     focus_search_cb,     NULL, NULL, NULL },
-        { "focus-search-alt", focus_search_cb,     NULL, NULL, NULL },
         /* go */
         { "go-back",          go_back_cb,          NULL, "false", NULL },
         { "go-forward",       go_forward_cb,       NULL, "false", NULL },


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