[gnome-builder/wip/gtk4-port] libide/gui: move various keybindings around



commit 6b9eb5bcd7082351755526e9e3ffc40e244ecd16
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jun 3 15:55:42 2022 -0700

    libide/gui: move various keybindings around
    
     * Into the plugin where they belong
     * Remove some unnecessary keybindings
     * Remap some others to be more predictable based on our other bindings

 src/libide/gui/gtk/keybindings.json          | 20 --------------------
 src/plugins/buildui/gtk/keybindings.json     |  9 +++++++++
 src/plugins/buildui/gtk/menus.ui             |  3 +--
 src/plugins/terminal/gtk/keybindings.json    | 11 +++++++++++
 src/plugins/terminal/terminal.gresource.xml  |  1 +
 src/plugins/web-browser/gtk/keybindings.json |  4 +++-
 src/plugins/web-browser/gtk/menus.ui         |  2 +-
 7 files changed, 26 insertions(+), 24 deletions(-)
---
diff --git a/src/libide/gui/gtk/keybindings.json b/src/libide/gui/gtk/keybindings.json
index ecaa03b2d..d532078c4 100644
--- a/src/libide/gui/gtk/keybindings.json
+++ b/src/libide/gui/gtk/keybindings.json
@@ -22,23 +22,3 @@
 /* Workspace Actions */
 { "trigger" : "<Control>comma", "action" : "app.preferences", "phase" : "capture" },
 { "trigger" : "<Alt>comma", "action" : "workbench.configure", "phase" : "capture" },
-
-/* Build Actions */
-{ "trigger" : "<Control><Shift>l", "action" : "win.show-build-log", "when" : "hasProject()", "phase" : 
"capture" },
-{ "trigger" : "<Control><Shift>r", "action" : "build-manager.rebuild", "when" : "hasProject()", "phase" : 
"capture" },
-{ "trigger" : "<Control><Shift>b", "action" : "build-manager.build", "when" : "hasProject()", "phase" : 
"capture" },
-
-/* Run Actions */
-{ "trigger" : "<Control><Shift>space", "action" : "run-manager.run", "when" : "hasProject()", "phase" : 
"capture" },
-
-/* New Terminal Actions */
-{ "trigger" : "<Control><Shift>t", "action" : "win.new-terminal", "when" : "canEdit()", "phase" : "capture" 
},
-{ "trigger" : "<Control><Alt><Shift>t", "action" : "win.new-terminal-in-config", "when" : "canEdit()", 
"phase" : "capture" },
-{ "trigger" : "<Control><Alt>t", "action" : "win.new-terminal-in-runner", "when" : "canEdit()", "phase" : 
"capture" },
-
-/* IdeTerminal */
-{ "trigger" : "<Control><Shift>c", "action" : "clipboard.copy", "when" : "inTerminal()", "phase" : "capture" 
},
-{ "trigger" : "<Control><Shift>v", "action" : "clipboard.paste", "when" : "inTerminal()", "phase" : 
"capture" },
-{ "trigger" : "<Control><Shift>f", "action" : "terminal.search-reveal", "when" : "inTerminal()", "phase" : 
"capture" },
-{ "trigger" : "<Control><Shift>braceleft", "action" : "page.move-left", "when" : "inTerminal()", "phase" : 
"capture" },
-{ "trigger" : "<Control><Shift>braceright", "action" : "page.move-right", "when" : "inTerminal()", "phase" : 
"capture" },
diff --git a/src/plugins/buildui/gtk/keybindings.json b/src/plugins/buildui/gtk/keybindings.json
index aeab6cc1c..b3232e0d2 100644
--- a/src/plugins/buildui/gtk/keybindings.json
+++ b/src/plugins/buildui/gtk/keybindings.json
@@ -1,2 +1,11 @@
+/* Build Actions */
+{ "trigger" : "<Control><Shift>l", "action" : "win.show-build-log", "when" : "hasProject()", "phase" : 
"capture" },
+{ "trigger" : "<Control><Alt><Shift>b", "action" : "build-manager.build", "when" : "hasProject()", "phase" : 
"capture" },
+
+/* Run Actions */
+{ "trigger" : "<Control><Shift>space", "action" : "run-manager.run", "when" : "hasProject()", "phase" : 
"capture" },
+
+/* Errors and Warnings Popover */
 { "trigger" : "<Control><Shift>e", "action" : "win.show-build-status-popover", "args" : "'errors'", "when" : 
"hasErrors() || hasWarnings()", "phase" : "capture" },
 { "trigger" : "<Control><Shift>w", "action" : "win.show-build-status-popover", "args" : "'warnings'", "when" 
: "hasErrors() || hasWarnings()", "phase" : "capture" },
+
diff --git a/src/plugins/buildui/gtk/menus.ui b/src/plugins/buildui/gtk/menus.ui
index a94566e55..3767e4219 100644
--- a/src/plugins/buildui/gtk/menus.ui
+++ b/src/plugins/buildui/gtk/menus.ui
@@ -49,12 +49,11 @@
       <item>
         <attribute name="label" translatable="yes">_Build</attribute>
         <attribute name="action">build-manager.build</attribute>
-        <attribute name="accel">&lt;ctrl&gt;&lt;shift&gt;b</attribute>
+        <attribute name="accel">&lt;ctrl&gt;&lt;alt&gt;&lt;shift&gt;b</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">_Rebuild</attribute>
         <attribute name="action">build-manager.rebuild</attribute>
-        <attribute name="accel">&lt;ctrl&gt;&lt;shift&gt;r</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">_Clean</attribute>
diff --git a/src/plugins/terminal/gtk/keybindings.json b/src/plugins/terminal/gtk/keybindings.json
new file mode 100644
index 000000000..5044c5d76
--- /dev/null
+++ b/src/plugins/terminal/gtk/keybindings.json
@@ -0,0 +1,11 @@
+/* New Terminal Actions */
+{ "trigger" : "<Control><Shift>t", "action" : "win.new-terminal", "when" : "canEdit()", "phase" : "capture" 
},
+{ "trigger" : "<Control><Alt><Shift>t", "action" : "win.new-terminal-in-config", "when" : "canEdit()", 
"phase" : "capture" },
+{ "trigger" : "<Control><Alt>t", "action" : "win.new-terminal-in-runner", "when" : "canEdit()", "phase" : 
"capture" },
+
+/* IdeTerminal */
+{ "trigger" : "<Control><Shift>c", "action" : "clipboard.copy", "when" : "inTerminal()", "phase" : "capture" 
},
+{ "trigger" : "<Control><Shift>v", "action" : "clipboard.paste", "when" : "inTerminal()", "phase" : 
"capture" },
+{ "trigger" : "<Control><Shift>f", "action" : "terminal.search-reveal", "when" : "inTerminal()", "phase" : 
"capture" },
+{ "trigger" : "<Control><Shift>braceleft", "action" : "page.move-left", "when" : "inTerminal()", "phase" : 
"capture" },
+{ "trigger" : "<Control><Shift>braceright", "action" : "page.move-right", "when" : "inTerminal()", "phase" : 
"capture" },
diff --git a/src/plugins/terminal/terminal.gresource.xml b/src/plugins/terminal/terminal.gresource.xml
index e6e7bcefa..02ecabed2 100644
--- a/src/plugins/terminal/terminal.gresource.xml
+++ b/src/plugins/terminal/terminal.gresource.xml
@@ -2,6 +2,7 @@
 <gresources>
   <gresource prefix="/plugins/terminal">
     <file preprocess="xml-stripblanks">gtk/menus.ui</file>
+    <file>gtk/keybindings.json</file>
     <file>terminal.plugin</file>
   </gresource>
 </gresources>
diff --git a/src/plugins/web-browser/gtk/keybindings.json b/src/plugins/web-browser/gtk/keybindings.json
index 6dbe6578f..51cc2a09c 100644
--- a/src/plugins/web-browser/gtk/keybindings.json
+++ b/src/plugins/web-browser/gtk/keybindings.json
@@ -1,2 +1,4 @@
-{ "trigger" : "<Control><Shift><Alt>b", "action" : "web-browser.new-page", "when" : "canEdit()", "phase" : 
"capture" },
+{ "trigger" : "<Control><Shift>b", "action" : "web-browser.new-page", "when" : "canEdit()", "phase" : 
"capture" },
+{ "trigger" : "<Control><Shift>r", "action" : "web-browser.reload", "args" : "true", "when" : "(page != 
null) && typeof(page).is_a(typeof(Ide.WebkitPage))", "phase" : "capture" },
+{ "trigger" : "<Control>r", "action" : "web-browser.reload", "args" : "false", "when" : "(page != null) && 
typeof(page).is_a(typeof(Ide.WebkitPage))", "phase" : "capture" },
 { "trigger" : "<Control>l", "action" : "web-browser.focus-address", "when" : "(page != null) && 
typeof(page).is_a(typeof(Ide.WebkitPage))", "phase" : "capture" },
diff --git a/src/plugins/web-browser/gtk/menus.ui b/src/plugins/web-browser/gtk/menus.ui
index 150b512b8..5058a16f4 100644
--- a/src/plugins/web-browser/gtk/menus.ui
+++ b/src/plugins/web-browser/gtk/menus.ui
@@ -5,7 +5,7 @@
       <item>
         <attribute name="label" translatable="yes">New _Browser Page</attribute>
         <attribute name="action">web-browser.new-page</attribute>
-        <attribute name="accel">&lt;ctrl&gt;&lt;alt&gt;&lt;shift&gt;b</attribute>
+        <attribute name="accel">&lt;ctrl&gt;&lt;shift&gt;b</attribute>
       </item>
     </section>
   </menu>


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