[gnome-builder/wip/libide-merge: 24/35] more focus movements
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide-merge: 24/35] more focus movements
- Date: Thu, 19 Mar 2015 08:56:34 +0000 (UTC)
commit 8c9cbff5439f315734d6bfd107ecfcd7951c93d7
Author: Christian Hergert <christian hergert me>
Date: Thu Mar 19 00:03:51 2015 -0700
more focus movements
data/keybindings/vim.css | 7 +++++--
src/views/gb-view-grid.c | 16 ++++++++++++++--
2 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/data/keybindings/vim.css b/data/keybindings/vim.css
index 8ec911f..fd0c8fd 100644
--- a/data/keybindings/vim.css
+++ b/data/keybindings/vim.css
@@ -896,14 +896,17 @@
@binding-set builder-vim-source-view-normal-ctrl-w
{
- bind "v" { "action" ("view-stack", "split-left", "") "grab_focus" () };
- bind "<ctrl>v" { "action" ("view-stack", "split-left", "") "grab_focus" () };
+ bind "v" { "action" ("view-stack", "split-right", "") "grab_focus" () };
+ bind "<ctrl>v" { "action" ("view-stack", "split-right", "") "grab_focus" () };
bind "c" { "action" ("view", "close", "") };
bind "<ctrl>c" { "action" ("view", "close", "") };
bind "s" { "action" ("view", "toggle-split", "") };
+ bind "w" { "action" ("view-grid", "focus-neighbor", "0") };
+ bind "<ctrl>w" { "action" ("view-grid", "focus-neighbor", "0") };
+
bind "l" { "action" ("view-grid", "focus-neighbor", "5") };
bind "h" { "action" ("view-grid", "focus-neighbor", "4") };
bind "j" { "action" ("view-grid", "focus-neighbor", "3") };
diff --git a/src/views/gb-view-grid.c b/src/views/gb-view-grid.c
index ff3204e..ece7abb 100644
--- a/src/views/gb-view-grid.c
+++ b/src/views/gb-view-grid.c
@@ -180,19 +180,32 @@ gb_view_grid_focus_neighbor (GbViewGrid *self,
GtkDirectionType dir,
GbViewStack *stack)
{
- GtkWidget *neighbor;
+ GtkWidget *active_view;
+ GtkWidget *neighbor = NULL;
g_return_if_fail (GB_IS_VIEW_GRID (self));
g_return_if_fail (GB_IS_VIEW_STACK (stack));
switch ((int)dir)
{
+ case GTK_DIR_UP:
+ case GTK_DIR_TAB_BACKWARD:
+ active_view = gb_view_stack_get_active_view (stack);
+ if (active_view && gtk_widget_child_focus (active_view, dir))
+ break;
+ /* fallthrough */
case GTK_DIR_LEFT:
neighbor = gb_view_grid_get_stack_before (self, stack);
if (!neighbor)
neighbor = gb_view_grid_get_last_stack (self);
break;
+ case GTK_DIR_DOWN:
+ case GTK_DIR_TAB_FORWARD:
+ active_view = gb_view_stack_get_active_view (stack);
+ if (active_view && gtk_widget_child_focus (active_view, dir))
+ break;
+ /* fallthrough */
case GTK_DIR_RIGHT:
neighbor = gb_view_grid_get_stack_after (self, stack);
if (!neighbor)
@@ -200,7 +213,6 @@ gb_view_grid_focus_neighbor (GbViewGrid *self,
break;
default:
- neighbor = NULL;
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]