power: Move the Power Off indicator to the power menu

It's only supposed to show if we have a battery, and hooking into
the power system is the easiest way of making that happen.

https://bugzilla.gnome.org/show_bug.cgi?id=705845
This commit is contained in:
Jasper St. Pierre 2013-06-17 18:19:20 -04:00
parent c05627a49e
commit 37487c243e
3 changed files with 3 additions and 6 deletions

View File

@ -858,9 +858,8 @@ const AggregateMenu = new Lang.Class({
this._indicators.add_child(this._network.indicators); this._indicators.add_child(this._network.indicators);
this._indicators.add_child(this._bluetooth.indicators); this._indicators.add_child(this._bluetooth.indicators);
this._indicators.add_child(this._power.indicators);
this._indicators.add_child(this._volume.indicators); this._indicators.add_child(this._volume.indicators);
this._indicators.add_child(this._system.indicators); this._indicators.add_child(this._power.indicators);
this._indicators.add_child(new St.Label({ text: '\u25BE', this._indicators.add_child(new St.Label({ text: '\u25BE',
y_expand: true, y_expand: true,
y_align: Clutter.ActorAlign.CENTER })); y_align: Clutter.ActorAlign.CENTER }));

View File

@ -109,10 +109,10 @@ const Indicator = new Lang.Class({
if (icon) { if (icon) {
let gicon = Gio.icon_new_for_string(icon); let gicon = Gio.icon_new_for_string(icon);
this._indicator.gicon = gicon; this._indicator.gicon = gicon;
this._indicator.show();
this._item.icon.gicon = gicon; this._item.icon.gicon = gicon;
} else { } else {
this._indicator.hide(); // If there's no battery, then we use the power icon.
this._indicator.icon_name = 'system-shutdown-symbolic';
} }
}, },

View File

@ -47,8 +47,6 @@ const Indicator = new Lang.Class({
_init: function() { _init: function() {
this.parent(); this.parent();
this._indicator = this.addIndicator(new Gio.ThemedIcon({ name: 'system-shutdown-symbolic' }));
this._screenSaverSettings = new Gio.Settings({ schema: SCREENSAVER_SCHEMA }); this._screenSaverSettings = new Gio.Settings({ schema: SCREENSAVER_SCHEMA });
this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA }); this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });
this._privacySettings = new Gio.Settings({ schema: PRIVACY_SCHEMA }); this._privacySettings = new Gio.Settings({ schema: PRIVACY_SCHEMA });