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



commit f5476e422fbb9283b8e449d73cdbc8b8ebdf76a8
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 a9fd91d..3d6b753 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1011,9 +1011,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) {
@@ -1094,6 +1094,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;
     }
@@ -1160,6 +1164,7 @@ const FolderIcon = new Lang.Class({
 
     onCompleteMakeSpaceForPopUp: function() {
         this._popup.popup();
+        this.view.setKeyboardFocus();
     },
 
     _calculateBoxPointerArrowSide: function() {
@@ -1303,7 +1308,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]