[gnome-builder/wip/gtk4-port: 1355/1774] libide/gui: add ctrl+w to close page containing focus




commit 424fbf4e786d02cd2e6348791d5366c87aabb4a7
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jun 3 16:05:26 2022 -0700

    libide/gui: add ctrl+w to close page containing focus

 src/libide/gui/gtk/keybindings.gsl  | 4 ++++
 src/libide/gui/gtk/keybindings.json | 1 +
 2 files changed, 5 insertions(+)
---
diff --git a/src/libide/gui/gtk/keybindings.gsl b/src/libide/gui/gtk/keybindings.gsl
index 38ee3a353..32e6fbe30 100644
--- a/src/libide/gui/gtk/keybindings.gsl
+++ b/src/libide/gui/gtk/keybindings.gsl
@@ -25,6 +25,10 @@ def inGrid()
   (focus != null) && (focus.get_ancestor(typeof(Ide.Grid)) != null)
 end
 
+def inPage()
+  (focus != null) && (focus.get_ancestor(typeof(Ide.Page)) != null)
+end
+
 def hasProject()
   workbench.has_project()
 end
diff --git a/src/libide/gui/gtk/keybindings.json b/src/libide/gui/gtk/keybindings.json
index d532078c4..7b87d715a 100644
--- a/src/libide/gui/gtk/keybindings.json
+++ b/src/libide/gui/gtk/keybindings.json
@@ -22,3 +22,4 @@
 /* Workspace Actions */
 { "trigger" : "<Control>comma", "action" : "app.preferences", "phase" : "capture" },
 { "trigger" : "<Alt>comma", "action" : "workbench.configure", "phase" : "capture" },
+{ "trigger" : "<Control>w", "action" : "frame.close-page-or-frame", "when" : "inPage()", "phase" : "bubble" 
},


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