[gnome-shell] dash: fix allocation loop when increasing icon size



commit 629b6faa22f5b9ed171b5361f81fb2ddcd981dde
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Dec 22 15:24:11 2012 +0100

    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 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 2c91710..daf1ad1 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];
     }
 });
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]