[gnome-shell/wip/paging] Fixed special case when we are at last page and only one row is shown and we have a folder. We have



commit 4a885ba467835c4c688250e2a9a00a44aaa3ba65
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Sat Jul 20 14:27:04 2013 +0200

    Fixed special case when we are at last page and only one row is shown
    and we have a folder. We have to not animate here and directly show the
    collection view.

 js/ui/appDisplay.js |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 6fb56be..cc7a456 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -134,6 +134,7 @@ const AppPages = new Lang.Class({
         this._parent = parent;
         this._folderIcons = [];
         this.doingTransitions = false;
+        this._popupExpansionNeeded = true;
     },
 
     _getItemId: function(item) {
@@ -260,11 +261,26 @@ const AppPages = new Lang.Class({
                 panViewUpNRows = folderNVisibleRowsAtOnce - rowsDown.length - emptyRows;
             }
         }
-        this._panViewForFolderView(rowsUp, rowsDown, panViewUpNRows, panViewDownNRows, iconActor);
+        // Especial case, last page and only one row, no rows down neither rows up, we call directly the
+        // popup
         this.updateIconOpacities(true);
+        if(panViewDownNRows > 0 && rowsDown.length == 0) {
+            this.displayingPopup = true;
+            this._popupExpansionNeeded = false;
+            iconActor.onCompleteMakeSpaceForPopUp();            
+        } else {
+            this._popupExpansionNeeded = true;
+            this._panViewForFolderView(rowsUp, rowsDown, panViewUpNRows, panViewDownNRows, iconActor);
+        }    
     },
     
     returnSpaceToOriginalPosition: function() {
+        this.updateIconOpacities(false);
+        if(!this._popupExpansionNeeded) {
+            this.displayingPopup = false;
+            return;
+        }
+        
         if(this._translatedRows) {
             for(let rowId in this._translatedRows) {
                 for(let childrenId in this._translatedRows[rowId]) {
@@ -280,7 +296,6 @@ const AppPages = new Lang.Class({
                 }
             }
         }
-        this.updateIconOpacities(false);
     },
     
     _panViewForFolderView: function(rowsUp, rowsDown, panViewUpNRows, panViewDownNRows, iconActor) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]