[gnome-builder] keybindings: fix surface selection keybindings



commit f7ff2195795788a8eed4205134440d362a946049
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jan 10 16:34:26 2019 -0800

    keybindings: fix surface selection keybindings

 src/libide/editor/ide-editor-surface-shortcuts.c | 6 ++++++
 src/plugins/buildui/gbp-buildui-config-surface.c | 9 +++++++++
 src/plugins/sysprof/gbp-sysprof-surface.c        | 8 ++++++++
 src/plugins/sysprof/gtk/menus.ui                 | 2 +-
 4 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/editor/ide-editor-surface-shortcuts.c 
b/src/libide/editor/ide-editor-surface-shortcuts.c
index 1e037c3e6..77b98b325 100644
--- a/src/libide/editor/ide-editor-surface-shortcuts.c
+++ b/src/libide/editor/ide-editor-surface-shortcuts.c
@@ -100,6 +100,12 @@ _ide_editor_surface_init_shortcuts (IdeEditorSurface *self)
                                               DZL_SHORTCUT_PHASE_GLOBAL,
                                               I_("editor.close-all"));
 
+  dzl_shortcut_controller_add_command_action (controller,
+                                              I_("org.gnome.builder.editor.focus"),
+                                              "<alt>1",
+                                              DZL_SHORTCUT_PHASE_GLOBAL,
+                                              "win.surface('editor')");
+
   dzl_shortcut_manager_add_shortcut_entries (NULL,
                                              editor_surface_entries,
                                              G_N_ELEMENTS (editor_surface_entries),
diff --git a/src/plugins/buildui/gbp-buildui-config-surface.c 
b/src/plugins/buildui/gbp-buildui-config-surface.c
index b2cd73b90..9d6cbe82f 100644
--- a/src/plugins/buildui/gbp-buildui-config-surface.c
+++ b/src/plugins/buildui/gbp-buildui-config-surface.c
@@ -292,6 +292,8 @@ gbp_buildui_config_surface_class_init (GbpBuilduiConfigSurfaceClass *klass)
 static void
 gbp_buildui_config_surface_init (GbpBuilduiConfigSurface *self)
 {
+  DzlShortcutController *controller;
+
   gtk_widget_init_template (GTK_WIDGET (self));
 
   gtk_list_box_set_header_func (self->config_list_box, header_func_cb, NULL, NULL);
@@ -301,6 +303,13 @@ gbp_buildui_config_surface_init (GbpBuilduiConfigSurface *self)
                            G_CALLBACK (gbp_buildui_config_surface_row_selected_cb),
                            self,
                            G_CONNECT_SWAPPED);
+
+  controller = dzl_shortcut_controller_find (GTK_WIDGET (self));
+  dzl_shortcut_controller_add_command_action (controller,
+                                              "org.gnome.builder.buildui.focus",
+                                              "<alt>comma",
+                                              DZL_SHORTCUT_PHASE_GLOBAL,
+                                              "win.surface('buildui')");
 }
 
 static void
diff --git a/src/plugins/sysprof/gbp-sysprof-surface.c b/src/plugins/sysprof/gbp-sysprof-surface.c
index 4f7da1d28..75baa59d3 100644
--- a/src/plugins/sysprof/gbp-sysprof-surface.c
+++ b/src/plugins/sysprof/gbp-sysprof-surface.c
@@ -104,6 +104,7 @@ gbp_sysprof_surface_class_init (GbpSysprofSurfaceClass *klass)
 static void
 gbp_sysprof_surface_init (GbpSysprofSurface *self)
 {
+  DzlShortcutController *controller;
   SpSelection *selection;
 
   gtk_widget_init_template (GTK_WIDGET (self));
@@ -112,6 +113,13 @@ gbp_sysprof_surface_init (GbpSysprofSurface *self)
   ide_surface_set_icon_name (IDE_SURFACE (self), "utilities-system-monitor-symbolic");
   ide_surface_set_title (IDE_SURFACE (self), _("Profiler"));
 
+  controller = dzl_shortcut_controller_find (GTK_WIDGET (self));
+  dzl_shortcut_controller_add_command_action (controller,
+                                              "org.gnome.builder.sysprof.focus",
+                                              "<alt>2",
+                                              DZL_SHORTCUT_PHASE_GLOBAL,
+                                              "win.surface('profiler')");
+
   g_signal_connect_object (self->info_bar_close,
                            "clicked",
                            G_CALLBACK (hide_info_bar),
diff --git a/src/plugins/sysprof/gtk/menus.ui b/src/plugins/sysprof/gtk/menus.ui
index 805a64ee5..9f6e5ba67 100644
--- a/src/plugins/sysprof/gtk/menus.ui
+++ b/src/plugins/sysprof/gtk/menus.ui
@@ -13,7 +13,7 @@
   <menu id="ide-primary-workspace-surfaces-menu">
     <section id="ide-primary-workspace-surfaces-menu-section">
       <item>
-        <attribute name="accel">&lt;alt&gt;3</attribute>
+        <attribute name="accel">&lt;alt&gt;2</attribute>
         <attribute name="action">win.surface</attribute>
         <attribute name="before">surface-menu-config</attribute>
         <attribute name="id">surface-menu-profiler</attribute>


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