From 629b6faa22f5b9ed171b5361f81fb2ddcd981dde Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sat, 22 Dec 2012 15:24:11 +0100 Subject: [PATCH] dash: fix allocation loop when increasing icon size The DashActor will known to allocate the show apps button only if the icon size is (temporarily) too big for the containing box, therefore it should request just that as the minimum size. This solves a glitch that happened when removing a favorite and at the same time causing the dash to expand. https://bugzilla.gnome.org/show_bug.cgi?id=690643 --- js/ui/dash.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/ui/dash.js b/js/ui/dash.js index 2c91710bf..daf1ad13e 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -354,6 +354,23 @@ const DashActor = new Lang.Class({ childBox.y1 = contentBox.y2 - showAppsNatHeight; childBox.y2 = contentBox.y2; showAppsButton.allocate(childBox, flags); + }, + + vfunc_get_preferred_height: function(forWidth) { + // We want to request the natural height of all our children + // as our natural height, so we chain up to StWidget (which + // then calls BoxLayout), but we only request the showApps + // button as the minimum size + + let [, natHeight] = this.parent(forWidth); + + let themeNode = this.get_theme_node(); + let adjustedForWidth = themeNode.adjust_for_width(forWidth); + let [, showAppsButton] = this.get_children(); + let [minHeight, ] = showAppsButton.get_preferred_height(adjustedForWidth); + [minHeight, ] = themeNode.adjust_preferred_height(minHeight, natHeight); + + return [minHeight, natHeight]; } });