[AppSwitcher] tweak the sizing code, which depended on the previous bug

This commit is contained in:
Dan Winship 2010-02-01 12:31:26 -05:00
parent df48e9d1c0
commit 54d385a0a9

View File

@ -512,7 +512,7 @@ SwitcherList.prototype = {
let totalSpacing = this._list.spacing * (this._items.length - 1); let totalSpacing = this._list.spacing * (this._items.length - 1);
alloc.min_size = this._items.length * maxChildMin + separatorWidth + totalSpacing; alloc.min_size = this._items.length * maxChildMin + separatorWidth + totalSpacing;
alloc.natural_size = this._items.length * maxChildNat + separatorWidth + totalSpacing; alloc.natural_size = alloc.min_size;
}, },
_getPreferredHeight: function (actor, forWidth, alloc) { _getPreferredHeight: function (actor, forWidth, alloc) {
@ -528,7 +528,7 @@ SwitcherList.prototype = {
if (this._squareItems) { if (this._squareItems) {
let [childMin, childNat] = this._maxChildWidth(-1); let [childMin, childNat] = this._maxChildWidth(-1);
maxChildMin = Math.max(childMin, maxChildMin); maxChildMin = Math.max(childMin, maxChildMin);
maxChildNat = Math.max(childNat, maxChildNat); maxChildNat = maxChildMin;
} }
alloc.min_size = maxChildMin; alloc.min_size = maxChildMin;