[gnome-shell/gnome-3-8] appDisplay: Implement folder keynav and shortcuts



commit a33df9b046e634c0ac61d88a6631b2182bd0d448
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Mar 6 21:42:36 2013 +0100

    appDisplay: Implement folder keynav and shortcuts
    
    When opening an application folder, it should take key focus to
    allow for keynav; also, Escape closing both folder and app picker
    is unexpected, it should only close the popup.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695314

 js/ui/appDisplay.js |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 22ae481..c450c67 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -625,10 +625,24 @@ const AppFolderPopup = new Lang.Class({
         this._boxPointer.actor.bind_property('opacity', closeButton, 'opacity',
                                              GObject.BindingFlags.SYNC_CREATE);
 
+        global.focus_manager.add_group(this.actor);
+
         source.actor.connect('destroy', Lang.bind(this,
             function() {
                 this.actor.destroy();
             }));
+        this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPress));
+    },
+
+    _onKeyPress: function(actor, event) {
+        if (!this._isOpen)
+            return false;
+
+        if (event.get_key_symbol() != Clutter.KEY_Escape)
+            return false;
+
+        this.popdown();
+        return true;
     },
 
     toggle: function() {
@@ -643,6 +657,7 @@ const AppFolderPopup = new Lang.Class({
             return;
 
         this.actor.show();
+        this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
 
         this._boxPointer.setArrowActor(this._source.actor);
         this._boxPointer.show(BoxPointer.PopupAnimation.FADE |


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