aggregateLayout: Fix natural width computation

Ouch, this went unnoticed for a long time: As the minimum size of menu
items is generally small (because its label can be ellipsized), we are
requesting the unellipsized width of the last "size child" instead of
the widest one.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/996
This commit is contained in:
Florian Müllner 2019-02-25 23:31:45 +01:00 committed by Jonas Ådahl
parent ffb9aa1ace
commit 70f4906ca5

View File

@ -729,7 +729,7 @@ class AggregateLayout extends Clutter.BoxLayout {
let child = this._sizeChildren[i]; let child = this._sizeChildren[i];
let [childMin, childNat] = child.get_preferred_width(forHeight); let [childMin, childNat] = child.get_preferred_width(forHeight);
minWidth = Math.max(minWidth, childMin); minWidth = Math.max(minWidth, childMin);
natWidth = Math.max(minWidth, childNat); natWidth = Math.max(natWidth, childNat);
} }
return [minWidth, natWidth]; return [minWidth, natWidth];
} }