[gnome-shell/wip/paging-release: 21/38] IconGrid: relayout also qhen hegith changes



commit b42532d05ba728e8f5ab2e1929b4d98b0bed3e88
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Mon Aug 12 15:23:36 2013 +0200

    IconGrid: relayout also qhen hegith changes

 js/ui/iconGrid.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 8f289af..376178c 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -309,9 +309,13 @@ const IconGrid = new Lang.Class({
                 nRows = 0;
             if (this._rowLimit)
                 nRows = Math.min(nRows, this._rowLimit);
+            let oldHeightUsedPerPage = this.usedHeightPerPage();
             let oldNPages = this._nPages;
             this._calculatePaginationValues(availHeightPerPage, nColumns, nRows);
-            if(oldNPages != this._nPages) {
+            // Take into account when the number of pages changed (then the height of the entire grid 
changed for sure)
+            // and also when the spacing is changed, sure the hegiht per page changed and the entire grid 
height changes, althougt
+            // maybe the number of pages doesn't change
+            if(oldNPages != this._nPages || oldHeightUsedPerPage != this.usedHeightPerPage()) {
                 this.emit('n-pages-changed', this._nPages);
             }
         }


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