messageTray: Use a GIcon for a notification's icon/secondary icon

Using a GIcon instead of an actor means that we can always create
a new icon with the right size from an old icon.

https://bugzilla.gnome.org/show_bug.cgi?id=680426
This commit is contained in:
Jasper St. Pierre
2012-09-14 11:33:52 -03:00
parent b7acb1d488
commit 928ea3bb01
4 changed files with 39 additions and 35 deletions

View File

@ -356,12 +356,10 @@ const NotificationDaemon = new Lang.Class({
ndata.actions, ndata.hints, ndata.notification];
let gicon = this._iconForNotificationData(icon, hints);
let iconActor = new St.Icon({ gicon: gicon,
icon_size: MessageTray.NOTIFICATION_ICON_SIZE });
if (notification == null) {
notification = new MessageTray.Notification(source, summary, body,
{ icon: iconActor,
{ gicon: gicon,
bannerMarkup: true });
ndata.notification = notification;
notification.connect('destroy', Lang.bind(this,
@ -386,7 +384,7 @@ const NotificationDaemon = new Lang.Class({
this._emitActionInvoked(ndata.id, actionId);
}));
} else {
notification.update(summary, body, { icon: iconActor,
notification.update(summary, body, { gicon: gicon,
bannerMarkup: true,
clear: true });
}