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



commit 0a3b6554a2c89304b7d77a755b6fd5674384241f
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 93cbab6..e808720 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]