[gnome-shell] appMenu: Update on icon theme changes



commit 04da29c9390cbbc1cfe6653ff1afcc79d68ed000
Author: Florian MÃllner <fmuellner gnome org>
Date:   Tue Oct 30 18:30:21 2012 +0100

    appMenu: Update on icon theme changes
    
    While we recreate icons on style changes elsewhere, the faded
    icon in the application menu will stick around after icon theme
    changes until another application is focused.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687224

 js/ui/panel.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 29165f6..9f36963 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -247,6 +247,10 @@ const AppMenuButton = new Lang.Class({
         this._container.connect('get-preferred-height', Lang.bind(this, this._getContentPreferredHeight));
         this._container.connect('allocate', Lang.bind(this, this._contentAllocate));
 
+        let textureCache = St.TextureCache.get_default();
+        textureCache.connect('icon-theme-changed',
+                             Lang.bind(this, this._onIconThemeChanged));
+
         this._iconBox = new Shell.Slicer({ name: 'appMenuIcon' });
         this._iconBox.connect('style-changed',
                               Lang.bind(this, this._onIconBoxStyleChanged));
@@ -332,6 +336,15 @@ const AppMenuButton = new Lang.Class({
         this._updateIconBoxClip();
     },
 
+    _onIconThemeChanged: function() {
+        if (this._iconBox.child == null)
+            return;
+
+        this._iconBox.child.destroy();
+        let icon = this._targetApp.get_faded_icon(2 * PANEL_ICON_SIZE);
+        this._iconBox.set_child(icon);
+    },
+
     _updateIconBoxClip: function() {
         let allocation = this._iconBox.allocation;
         if (this._iconBottomClip > 0)



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