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



commit 665220b8f0dd937153b6d0059a0bcd05637c683b
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 63453de..b08c9c7 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);
                 Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
                     global.log("Put a relayout " + this._nPages);


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