[gnome-shell/wip/re-search: 2/16] iconGrid: Handle preferred height requests for infinite widths



commit fda3a9b410b028c8188ef3bb0a121d05019d1cfc
Author: Rui Matos <tiagomatos gmail com>
Date:   Sun Jul 1 18:38:28 2012 +0200

    iconGrid: Handle preferred height requests for infinite widths
    
    Request enough height to fit all children in a single line instead of
    requesting 0.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679168

 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 81f5cef..04b8caf 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -198,7 +198,11 @@ const IconGrid = new Lang.Class({
 
     _getPreferredHeight: function (grid, forWidth, alloc) {
         let children = this._getVisibleChildren();
-        let [nColumns, usedWidth] = this._computeLayout(forWidth);
+        let nColumns;
+        if (forWidth < 0)
+            nColumns = children.length;
+        else
+            nColumns = this._computeLayout(forWidth)[0];
         let nRows;
         if (nColumns > 0)
             nRows = Math.ceil(children.length / nColumns);



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