[gnome-builder/wip/chergert/perspective] prefs: ctrl+. to focus global search
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/perspective] prefs: ctrl+. to focus global search
- Date: Wed, 11 Nov 2015 05:33:25 +0000 (UTC)
commit 298b43920ce5ae6db90f701e5bf12a753168b1da
Author: Christian Hergert <chergert redhat com>
Date: Tue Nov 10 21:33:18 2015 -0800
prefs: ctrl+. to focus global search
libide/ide-application.c | 2 +-
libide/preferences/ide-preferences-perspective.c | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-application.c b/libide/ide-application.c
index cbabbb8..518838a 100644
--- a/libide/ide-application.c
+++ b/libide/ide-application.c
@@ -282,7 +282,7 @@ ide_application_load_keybindings (IdeApplication *self)
{ "workbench.focus-stack(4)", "<ctrl>4" },
{ "workbench.focus-stack(5)", "<ctrl>5" },
{ "workbench.show-gear-menu", "F10" },
- { "workbench.global-search", "<ctrl>period" },
+ { "perspective.global-search", "<ctrl>period" },
{ "app.preferences", "<Primary>comma" },
{ "app.shortcuts", "<ctrl>question" },
{ "workbench.new-document", "<ctrl>n" },
diff --git a/libide/preferences/ide-preferences-perspective.c
b/libide/preferences/ide-preferences-perspective.c
index a3fe059..e770ad3 100644
--- a/libide/preferences/ide-preferences-perspective.c
+++ b/libide/preferences/ide-preferences-perspective.c
@@ -216,6 +216,18 @@ go_back_activate (GSimpleAction *action,
}
static void
+global_search_activate (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ IdePreferencesPerspective *self = user_data;
+
+ g_assert (IDE_IS_PREFERENCES_PERSPECTIVE (self));
+
+ gtk_widget_grab_focus (GTK_WIDGET (self->search_entry));
+}
+
+static void
ide_preferences_perspective_search_entry_changed (IdePreferencesPerspective *self,
GtkSearchEntry *search_entry)
{
@@ -236,6 +248,7 @@ ide_preferences_perspective_init (IdePreferencesPerspective *self)
{
static const GActionEntry entries[] = {
{ "go-back", go_back_activate },
+ { "global-search", global_search_activate },
};
gtk_widget_init_template (GTK_WIDGET (self));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]