[gnome-shell] iconGrid: Take extra spacing into account for height requests
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] iconGrid: Take extra spacing into account for height requests
- Date: Thu, 21 Feb 2013 00:39:05 +0000 (UTC)
commit aad5d98b43c33f789e02073998443522254acbe8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Feb 19 21:18:48 2013 -0500
iconGrid: Take extra spacing into account for height requests
This fixes the clipped app picker in the overview.
https://bugzilla.gnome.org/show_bug.cgi?id=694234
js/ui/iconGrid.js | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 98e5761..b3755cb 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -218,11 +218,14 @@ const IconGrid = new Lang.Class({
_getPreferredHeight: function (grid, forWidth, alloc) {
let children = this._getVisibleChildren();
- let nColumns;
- if (forWidth < 0)
+ let nColumns, spacing;
+ if (forWidth < 0) {
nColumns = children.length;
- else
- nColumns = this._computeLayout(forWidth)[0];
+ spacing = this._spacing;
+ } else {
+ [nColumns, , spacing] = this._computeLayout(forWidth);
+ }
+
let nRows;
if (nColumns > 0)
nRows = Math.ceil(children.length / nColumns);
@@ -230,7 +233,7 @@ const IconGrid = new Lang.Class({
nRows = 0;
if (this._rowLimit)
nRows = Math.min(nRows, this._rowLimit);
- let totalSpacing = Math.max(0, nRows - 1) * this._spacing;
+ let totalSpacing = Math.max(0, nRows - 1) * spacing;
let height = nRows * this._vItemSize + totalSpacing;
alloc.min_size = height;
alloc.natural_size = height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]