[gnome-shell] MessageTray: restore symbolic icons to notification buttons



commit 9aa84ec54a2df50ac5a7caf86f1639297fb10c22
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Jan 19 18:50:49 2013 +0100

    MessageTray: restore symbolic icons to notification buttons
    
    These were lost when we moved away with StIconType. The idea was that
    apps needed to include -symbolic in their action IDs, but apps were
    not updated, and it never makes sense to have non symbolic icons there,
    so let's restore the previous behavior.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692091

 js/ui/messageTray.js |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 451afb5..44d884f 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -243,6 +243,10 @@ function makeCloseButton() {
     return closeButton;
 }
 
+function strHasSuffix(string, suffix) {
+    return string.substr(-suffix.length) == suffix;
+}
+
 // Notification:
 // @source: the notification's Source
 // @title: the title
@@ -669,9 +673,10 @@ const Notification = new Lang.Class({
         let button = new St.Button({ can_focus: true });
         button._actionId = id;
 
-        if (this._useActionIcons && Gtk.IconTheme.get_default().has_icon(id)) {
+        let iconName = strHasSuffix(id, '-symbolic') ? id : id + '-symbolic';
+        if (this._useActionIcons && Gtk.IconTheme.get_default().has_icon(iconName)) {
             button.add_style_class_name('notification-icon-button');
-            button.child = new St.Icon({ icon_name: id });
+            button.child = new St.Icon({ icon_name: iconName });
         } else {
             button.add_style_class_name('notification-button');
             button.label = label;



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