Revert "[appSwitcher] Remove unneeded workaround"

This reverts commit a1bfaac5a2.

https://bugzilla.gnome.org/show_bug.cgi?id=613194
This commit is contained in:
Adel Gadllah 2010-06-17 17:17:57 +02:00
parent 4800a80c3a
commit 362fc78dcf

View File

@ -858,8 +858,6 @@ AppSwitcher.prototype = {
_getPreferredHeight: function (actor, forWidth, alloc) { _getPreferredHeight: function (actor, forWidth, alloc) {
let j = 0; let j = 0;
let height = 0;
while(this._items.length > 1 && this._items[j].style_class != 'item-box') { while(this._items.length > 1 && this._items[j].style_class != 'item-box') {
j++; j++;
} }
@ -870,11 +868,17 @@ AppSwitcher.prototype = {
if (this._separator) if (this._separator)
totalSpacing += this._separator.width + this._list.spacing; totalSpacing += this._separator.width + this._list.spacing;
// We just assume the whole screen here due to weirdness happing with the passed width
let focus = global.get_focus_monitor();
let parentPadding = this.actor.get_parent().get_theme_node().get_horizontal_padding();
let availWidth = focus.width - parentPadding - this.actor.get_theme_node().get_horizontal_padding();
let height = 0;
for(let i = 0; i < iconSizes.length; i++) { for(let i = 0; i < iconSizes.length; i++) {
this._iconSize = iconSizes[i]; this._iconSize = iconSizes[i];
height = iconSizes[i] + iconSpacing; height = iconSizes[i] + iconSpacing;
let w = height * this._items.length + totalSpacing; let w = height * this._items.length + totalSpacing;
if (w <= forWidth) if (w <= availWidth)
break; break;
} }