From c985fdccba00353f18f2c7e36eb52dcb96f5cdd5 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Sun, 1 Jul 2012 18:38:28 +0200 Subject: [PATCH] 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 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 81f5cef84..04b8caf69 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);