[gnome-shell/wip/aggregate-menu: 55/63] power: Move the Power Off indicator to the power menu



commit 48fb16ff70e3f09bc27c7480f64a15db524478bd
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jun 17 18:19:20 2013 -0400

    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.

 js/ui/panel.js         |    3 +--
 js/ui/status/power.js  |    4 ++--
 js/ui/status/system.js |    2 --
 3 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 16fe909..1ded175 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -860,10 +860,9 @@ const AggregateMenu = new Lang.Class({
 
         this._indicators.add_child(this._network.indicators);
         this._indicators.add_child(this._bluetooth.indicators);
-        this._indicators.add_child(this._power.indicators);
         this._indicators.add_child(this._rfkill.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',
                                                   y_expand: true,
                                                   y_align: Clutter.ActorAlign.CENTER }));
diff --git a/js/ui/status/power.js b/js/ui/status/power.js
index 2818a29..7754683 100644
--- a/js/ui/status/power.js
+++ b/js/ui/status/power.js
@@ -109,10 +109,10 @@ const Indicator = new Lang.Class({
         if (icon) {
             let gicon = Gio.icon_new_for_string(icon);
             this._indicator.gicon = gicon;
-            this._indicator.show();
             this._item.icon.gicon = gicon;
         } else {
-            this._indicator.hide();
+            // If there's no battery, then we use the power icon.
+            this._indicator.icon_name = 'system-shutdown-symbolic';
         }
     },
 
diff --git a/js/ui/status/system.js b/js/ui/status/system.js
index ac4c132..a7729c1 100644
--- a/js/ui/status/system.js
+++ b/js/ui/status/system.js
@@ -47,8 +47,6 @@ const Indicator = new Lang.Class({
     _init: function() {
         this.parent();
 
-        this._indicator = this.addIndicator(new Gio.ThemedIcon({ name: 'system-shutdown-symbolic' }));
-
         this._screenSaverSettings = new Gio.Settings({ schema: SCREENSAVER_SCHEMA });
         this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });
         this._privacySettings = new Gio.Settings({ schema: PRIVACY_SCHEMA });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]