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



commit f4ce9a5d6c76f270ece4a43717724d9221a77c50
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 089c3f9..598ebde 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -987,6 +987,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
@@ -1058,6 +1062,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;
@@ -1243,7 +1260,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]