From 3614da684533d755a5d872fb18819dd8c4cef525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 6 Mar 2015 18:05:29 +0100 Subject: [PATCH] messageTray: Fix custom notification icons NotificationMessages set the icon either from the corresponding notification's gicon property, or fall back to the source icon. Except that we never actually set a notification's gicon property to the provided icon, so we currently just always fall back, whoops! --- js/ui/messageTray.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index f4b4f8876..d809ca88b 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -571,8 +571,10 @@ const Notification = new Lang.Class({ let oldFocus = global.stage.key_focus; - if (this._icon && (params.gicon || params.clear)) { - this._icon.destroy(); + if (params.gicon || params.clear) { + this.gicon = params.gicon; + if (this._icon) + this._icon.destroy(); this._icon = null; } @@ -604,8 +606,8 @@ const Notification = new Lang.Class({ if (!this._scrollArea && !this._actionArea) this._table.remove_style_class_name('multi-line-notification'); - if (params.gicon) { - this._icon = new St.Icon({ gicon: params.gicon, + if (this.gicon) { + this._icon = new St.Icon({ gicon: this.gicon, icon_size: this.ICON_SIZE }); } else { this._icon = this.source.createIcon(this.ICON_SIZE);