[gnome-shell] base-icon: Enforce the requested icon size



commit a78e75775d20bd626ec0ee8670c925ed62d8149c
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Feb 10 16:30:28 2011 +0100

    base-icon: Enforce the requested icon size
    
    Mainly due to StTextureCache's way of handling fallback icons, an
    implementation of BaseIcon.createIcon() may return an icon smaller
    than the requested size. Given that BaseIcon is not used for isolated
    elements, but rather for groups of related items (App view, Dash,
    Search Results, ...), having some elements end up with the wrong
    size is more annoying than having some elements end up ugly due to
    scaling, so explicitly enforce the requested icon size.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=642043

 js/ui/iconGrid.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 91cc0c3..f2d046c 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -126,6 +126,12 @@ BaseIcon.prototype = {
         this.icon.destroy();
         this.iconSize = size;
         this.icon = this.createIcon(this.iconSize);
+
+        // The icon returned by createIcon() might actually be smaller than
+        // the requested icon size (for instance StTextureCache does this
+        // for fallback icons), so set the size explicitly.
+        this.icon.set_size(this.iconSize, this.iconSize);
+
         this._iconBin.child = this.icon;
     },
 



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