[gnome-shell/wip/paging-release2: 20/23] appDisplay: Change keyboard focus from FolderPopup to FolderView



commit 8aa4d0ad1de824285aaae9c33c288d17537c3b36
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Mon Aug 26 10:59:39 2013 +0200

    appDisplay: Change keyboard focus from FolderPopup to FolderView
    
    Since now FolderView has its own widget, the focus has to
    be moved to the widget inside the FolderView when the popup
    opens. Currently the focus was moved to the FolderPopup
    widget, which is wrong with the new implementation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706081

 js/ui/appDisplay.js |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 3ecbccf..81c7abb 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1010,9 +1010,9 @@ const FolderView = new Lang.Class({
 
         this.actor = new St.ScrollView({ overlay_scrollbars: true });
         this.actor.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
-        let scrollableContainer = new St.BoxLayout({ vertical: true, reactive: true });
-        scrollableContainer.add_actor(this._grid.actor);
-        this.actor.add_actor(scrollableContainer);
+        this._scrollableContainer = new St.BoxLayout({ vertical: true, reactive: true });
+        this._scrollableContainer.add_actor(this._grid.actor);
+        this.actor.add_actor(this._scrollableContainer);
     },
 
     _getItemId: function(item) {
@@ -1093,6 +1093,10 @@ const FolderView = new Lang.Class({
         return Math.min(this._grid.nRows(availWidthPerPage), maxRows);
     },
 
+    setKeyboardFocus: function() {
+        this._scrollableContainer.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
+    },
+    
     setPaddingOffsets: function(offset) {
         this._offsetForEachSide = offset;
     }
@@ -1159,6 +1163,7 @@ const FolderIcon = new Lang.Class({
 
     onCompleteMakeSpaceForPopUp: function() {
         this._popup.popup();
+        this.view.setKeyboardFocus();
     },
 
     _calculateBoxPointerArrowSide: function() {
@@ -1302,7 +1307,6 @@ 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]