panel: Add an easier way of adding items to the system status area

Extensions often want to add items to the system status area, so it
is useful to add a convenience API for it. Also, we now allow
for cleaner destruction of panel objects, by just calling destroy()
on it.
Based on a patch by Jasper St. Pierre.

https://bugzilla.gnome.org/show_bug.cgi?id=653205
This commit is contained in:
Giovanni Campagna
2011-08-22 23:19:13 +02:00
committed by Jasper St. Pierre
parent b76efe17d6
commit 08126e5a38
2 changed files with 35 additions and 4 deletions

View File

@ -2,6 +2,7 @@
const Clutter = imports.gi.Clutter;
const Gtk = imports.gi.Gtk;
const Signals = imports.signals;
const St = imports.gi.St;
const Lang = imports.lang;
@ -80,8 +81,18 @@ Button.prototype = {
this.actor.add_style_pseudo_class('active');
else
this.actor.remove_style_pseudo_class('active');
},
destroy: function() {
this.actor._delegate = null;
this.menu.destroy();
this.actor.destroy();
this.emit('destroy');
}
};
Signals.addSignalMethods(Button.prototype);
/* SystemStatusButton:
*