From caade78e79b63d2682df89a5e05bb4a13649a39f Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 22 Aug 2011 14:29:22 -0400 Subject: [PATCH] popupMenu: do height-for-width negotiation https://bugzilla.gnome.org/show_bug.cgi?id=652837 --- js/ui/popupMenu.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 2551d687e..ef8a5494e 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -214,7 +214,7 @@ PopupBaseMenuItem.prototype = { let child = this._children[i]; if (i > 0) width += this._spacing; - let [min, natural] = child.actor.get_preferred_width(forHeight); + let [min, natural] = child.actor.get_preferred_width(-1); width += natural; } } @@ -225,7 +225,7 @@ PopupBaseMenuItem.prototype = { let height = 0; for (let i = 0; i < this._children.length; i++) { let child = this._children[i]; - let [min, natural] = child.actor.get_preferred_height(-1); + let [min, natural] = child.actor.get_preferred_height(forWidth); if (natural > height) height = natural; } @@ -319,7 +319,7 @@ PopupBaseMenuItem.prototype = { } } - let [minHeight, naturalHeight] = child.actor.get_preferred_height(-1); + let [minHeight, naturalHeight] = child.actor.get_preferred_height(childBox.x2 - childBox.x1); childBox.y1 = Math.round(box.y1 + (height - naturalHeight) / 2); childBox.y2 = childBox.y1 + naturalHeight;