panel: Move statusmenu initialization in the constructor

While related to the status area, the user status button is clearly
not a status icon, and it does not make too much sense in
startStatusArea(), which is about filling the status area with
icons. Also, the status icon container is added to the panel in
the constructor, in fact, the user status button is the only "toplevel"
panel element which is initialized elsewhere. Not a crucial change,
but makes for a nice read anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=642697
This commit is contained in:
Florian Müllner 2011-02-18 02:34:45 +01:00
parent 9925264410
commit 4dec1bc846

View File

@ -703,6 +703,10 @@ Panel.prototype = {
this._rightBox.add(this._trayBox);
this._rightBox.add(this._statusBox);
this._statusmenu = new StatusMenu.StatusMenuButton();
this._menus.addMenu(this._statusmenu.menu);
this._rightBox.add(this._statusmenu.actor);
Main.statusIconDispatcher.connect('status-icon-added', Lang.bind(this, this._onTrayIconAdded));
Main.statusIconDispatcher.connect('status-icon-removed', Lang.bind(this, this._onTrayIconRemoved));
@ -762,10 +766,6 @@ Panel.prototype = {
this._statusBox.add(indicator.actor);
this._menus.addMenu(indicator.menu);
}
this._statusmenu = new StatusMenu.StatusMenuButton();
this._menus.addMenu(this._statusmenu.menu);
this._rightBox.add(this._statusmenu.actor);
},
startupAnimation: function() {