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



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

    appDisplay: Change keoyboard 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.

 js/ui/appDisplay.js |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 2836a4a..ff82ada 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -986,6 +986,10 @@ const FolderView = new Lang.Class({
         maxRowsPerPage -= 1;
         return maxRowsPerPage;
     },
+
+    setKeyboardFocus: function() {
+        this._widget.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
+    },
     
     updateBoxPointerOffsets: function(boxPointerOffsets) {
         // We have to ensure the folder view boxpointer and the close button
@@ -1057,6 +1061,19 @@ const FolderIcon = new Lang.Class({
         return usedHeight;   
     },
 
+    makeSpaceForPopUp: function() {
+        this._parentView.makeSpaceForPopUp(this, this._boxPointerArrowside, 
this.view.nRowsDisplayedAtOnce());
+    },
+
+    returnSpaceToOriginalPosition: function() {
+        this._parentView.returnSpaceToOriginalPosition();
+    },
+
+    onCompleteMakeSpaceForPopUp: function() {
+        this._popup.popup();
+        this.view.setKeyboardFocus();
+    },
+
     _calculateBoxPointerArrowSide: function() {
         let absoluteActorYPosition = this.actor.get_transformed_position()[1];
         let spaceTop = absoluteActorYPosition;
@@ -1242,7 +1259,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]