messageTray: Hook SourceActor up to source icon changes automatically

Instead of manually tracking source icon changes, or requiring a manual
call to _setSummaryIcon, add a way to emit a signal when we're guaranteed
the icon has been changed, and then the source actor will automatically
update the icon.
_setSummaryIcon is still available for sources such as the notification
daemon, that require special treatment for the summary icon (to be used
with tray icons)

https://bugzilla.gnome.org/show_bug.cgi?id=680426
This commit is contained in:
Jasper St. Pierre
2012-07-23 01:07:51 -03:00
committed by Giovanni Campagna
parent b9226fbcbd
commit 5991c8dca3
4 changed files with 28 additions and 15 deletions

View File

@ -140,9 +140,7 @@ const NotificationsBox = new Lang.Class({
_makeNotificationSource: function(source) {
let box = new St.BoxLayout({ style_class: 'screen-shield-notification-source' });
let iconClone = source.createIcon(SUMMARY_ICON_SIZE);
let sourceActor = new MessageTray.SourceActor(source, SUMMARY_ICON_SIZE);
sourceActor.setIcon(iconClone);
box.add(sourceActor.actor, { y_fill: true });
let textBox = new St.BoxLayout({ vertical: true });