From 94941843e352946aa3355187969bb5e2c52a11c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 5 Apr 2013 18:04:56 +0200 Subject: [PATCH] apps-menu: Allow for keynav between categories/applications PanelMenu.Button listens to key-press-events on the corresponding menu to move focus to neighboring buttons on left/right arrow. In order to allow keynav from the category list on the left to the application list on the right and vice-versa, we may need to suppress the parent behavior depending on the currently focused actor, so overwrite the signal handler accordingly. https://bugzilla.gnome.org/show_bug.cgi?id=693074 --- extensions/apps-menu/extension.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index e88bbdc4..3c1bc22b 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -312,6 +312,17 @@ const ApplicationsButton = new Lang.Class({ return false; }, + _onMenuKeyPress: function(actor, event) { + let symbol = event.get_key_symbol(); + if (symbol == Clutter.KEY_Left || symbol == Clutter.KEY_Right) { + let direction = symbol == Clutter.KEY_Left ? Gtk.DirectionType.LEFT + : Gtk.DirectionType.RIGHT; + if (this.menu.actor.navigate_focus(global.stage.key_focus, direction, false)) + return true; + } + return this.parent(actor, event); + }, + _onVertSepRepaint: function(area) { let cr = area.get_context(); let themeNode = area.get_theme_node();