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



commit fa8e35c078a9f7ca901026031f51b25ae8064ffa
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 1d303ab..19bda99 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -920,9 +920,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) {
@@ -1003,6 +1003,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;
     }
@@ -1062,6 +1066,7 @@ const FolderIcon = new Lang.Class({
                         this._parentView.disconnect(id);
                         this._popup.popup();
                         this._updatePopupPosition();
+                        this.view.setKeyboardFocus();
                     }));
         this._parentView.makeSpaceForPopup(this, this._boxPointerArrowside, 
this.view.nRowsDisplayedAtOnce());
     },
@@ -1202,7 +1207,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]