[gnome-shell/gnome-3-16] dash: Revert mislead cleanup



commit ae8dc11c557a1f9e2d7cdde1e3164b0059745d97
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Oct 3 23:44:48 2015 +0200

    dash: Revert mislead cleanup
    
    When adjusting dash icon sizes, we compute the icon padding by subtracting
    the configured icon size from the first icon actor's preferred size. To
    make sure that the preferred size correctly corresponds to the current
    dash icon size even while the icon is animating, we enforce the size
    before the size request. For that we used to temporarily manipulate
    the icon texture size directly, but commit e92d204d425 cleaned this
    up to use the setIconSize() method instead.
    This does not work however, as the icon actor's iconSize property will
    always match the dash iconSize property, making the method a noop. So
    go back to the original approach of enforcing the texture size to make
    sure we always base our computations on correct values.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745649

 js/ui/dash.js |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 246bc10..e809f87 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -644,15 +644,13 @@ const Dash = new Lang.Class({
         let firstIcon = firstButton._delegate.icon;
 
         let minHeight, natHeight;
+        let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
 
         // Enforce the current icon size during the size request
-        firstIcon.setIconSize(this.iconSize);
+        let [currentWidth, currentHeight] = firstIcon.icon.get_size();
+        firstIcon.icon.set_size(this.iconSize * scaleFactor, this.iconSize * scaleFactor);
         [minHeight, natHeight] = firstButton.get_preferred_height(-1);
-
-        let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
-        let iconSizes = baseIconSizes.map(function(s) {
-            return s * scaleFactor;
-        });
+        firstIcon.icon.set_size(currentWidth, currentHeight);
 
         // Subtract icon padding and box spacing from the available height
         availHeight -= iconChildren.length * (natHeight - this.iconSize * scaleFactor) +
@@ -660,6 +658,10 @@ const Dash = new Lang.Class({
 
         let availSize = availHeight / iconChildren.length;
 
+        let iconSizes = baseIconSizes.map(function(s) {
+            return s * scaleFactor;
+        });
+
         let newIconSize = baseIconSizes[0];
         for (let i = 0; i < iconSizes.length; i++) {
             if (iconSizes[i] < availSize)


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