[gnome-builder] tree: add some accelerators



commit fe9dceb795b42b689f0a9fa5ba2fa9946e0c90ac
Author: Christian Hergert <christian hergert me>
Date:   Wed Apr 15 22:26:41 2015 -0700

    tree: add some accelerators
    
    Add F2 for rename, Delete for move-to-trash.

 data/keybindings/default.css              |    4 ++++
 data/keybindings/emacs.css                |    7 +++++++
 data/keybindings/shared.css               |    6 ++++++
 data/keybindings/vim.css                  |    7 +++++++
 src/resources/gnome-builder.gresource.xml |    1 +
 5 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/data/keybindings/default.css b/data/keybindings/default.css
index 8109dbe..0edcbc6 100644
--- a/data/keybindings/default.css
+++ b/data/keybindings/default.css
@@ -1,3 +1,4 @@
+ import url("resource:///org/gnome/builder/keybindings/shared.css");
 
 @binding-set default-ide-source-view
 {
@@ -41,3 +42,6 @@ IdeSourceViewMode.default {
   gtk-key-bindings: default-ide-source-view;
 }
 
+GbProjectTree {
+  gtk-key-bindings: builder-gb-project-tree;
+}
diff --git a/data/keybindings/emacs.css b/data/keybindings/emacs.css
index 8a694bf..699f4ef 100644
--- a/data/keybindings/emacs.css
+++ b/data/keybindings/emacs.css
@@ -1,3 +1,5 @@
+ import url("resource:///org/gnome/builder/keybindings/shared.css");
+
 @binding-set builder-emacs-text-entry
 {
   bind "<ctrl>b" { "move-cursor" (logical-positions, -1, 0) };
@@ -142,3 +144,8 @@ IdeSourceViewMode.emacs-x {
 GtkTreeView {
   gtk-key-bindings: builder-emacs-tree-view;
 }
+
+GbProjectTree {
+  gtk-key-bindings: builder-emacs-tree-view,
+                    builder-gb-project-tree;
+}
diff --git a/data/keybindings/shared.css b/data/keybindings/shared.css
new file mode 100644
index 0000000..ab68e00
--- /dev/null
+++ b/data/keybindings/shared.css
@@ -0,0 +1,6 @@
+ binding-set builder-gb-project-tree
+{
+  bind "Delete" { "action" ("project-tree", "move-to-trash", "") };
+  bind "F2" { "action" ("project-tree", "rename-file", "") };
+}
+
diff --git a/data/keybindings/vim.css b/data/keybindings/vim.css
index 29e7952..0aa65c4 100644
--- a/data/keybindings/vim.css
+++ b/data/keybindings/vim.css
@@ -74,6 +74,8 @@
  *   -- Christian
  */
 
+ import url("resource:///org/gnome/builder/keybindings/shared.css");
+
 @binding-set builder-vim-source-view
 {
   bind "Escape" { "end-macro" ()
@@ -1562,3 +1564,8 @@ IdeSourceViewMode.vim-visual-block {
 GtkTreeView {
   gtk-key-bindings: builder-vim-tree-view;
 }
+
+GbProjectTree {
+  gtk-key-bindings: builder-vim-tree-view,
+                    builder-gb-project-tree;
+}
diff --git a/src/resources/gnome-builder.gresource.xml b/src/resources/gnome-builder.gresource.xml
index 45f0620..3134ef6 100644
--- a/src/resources/gnome-builder.gresource.xml
+++ b/src/resources/gnome-builder.gresource.xml
@@ -30,6 +30,7 @@
 
     <file alias="keybindings/default.css">../../data/keybindings/default.css</file>
     <file alias="keybindings/emacs.css">../../data/keybindings/emacs.css</file>
+    <file alias="keybindings/shared.css">../../data/keybindings/shared.css</file>
     <file alias="keybindings/vim.css">../../data/keybindings/vim.css</file>
 
     <file alias="theme/Adwaita.css">../../data/theme/Adwaita.css</file>


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