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!
This commit is contained in:
Florian Müllner 2015-03-06 18:05:29 +01:00
parent 8aa1765f24
commit 3614da6845

View File

@ -571,8 +571,10 @@ const Notification = new Lang.Class({
let oldFocus = global.stage.key_focus; let oldFocus = global.stage.key_focus;
if (this._icon && (params.gicon || params.clear)) { if (params.gicon || params.clear) {
this._icon.destroy(); this.gicon = params.gicon;
if (this._icon)
this._icon.destroy();
this._icon = null; this._icon = null;
} }
@ -604,8 +606,8 @@ const Notification = new Lang.Class({
if (!this._scrollArea && !this._actionArea) if (!this._scrollArea && !this._actionArea)
this._table.remove_style_class_name('multi-line-notification'); this._table.remove_style_class_name('multi-line-notification');
if (params.gicon) { if (this.gicon) {
this._icon = new St.Icon({ gicon: params.gicon, this._icon = new St.Icon({ gicon: this.gicon,
icon_size: this.ICON_SIZE }); icon_size: this.ICON_SIZE });
} else { } else {
this._icon = this.source.createIcon(this.ICON_SIZE); this._icon = this.source.createIcon(this.ICON_SIZE);