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



commit 4e78f7605f64ad69eace760fa36e8d96d3d0f048
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 b437024..346ec9c 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -923,9 +923,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) {
@@ -1006,6 +1006,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;
     }
@@ -1065,6 +1069,7 @@ const FolderIcon = new Lang.Class({
                         this._parentView.disconnect(id);
                         this._popup.popup();
                         this._updatePopupPosition();
+                        this.view.setKeyboardFocus();
                     }));
         this._parentView.makeSpaceForPopup(this.actor.y, 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]