[gnome-shell/wip/maximize: 1/2] status menu hackery
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/maximize: 1/2] status menu hackery
- Date: Mon, 6 Jul 2015 06:12:14 +0000 (UTC)
commit d20789bc615b477dc180f55ce3c4bd44b7974a15
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Jun 23 10:25:29 2015 -0700
status menu hackery
js/ui/panel.js | 1 -
js/ui/popupMenu.js | 5 -----
js/ui/status/bluetooth.js | 4 ++--
js/ui/status/location.js | 15 +--------------
js/ui/status/network.js | 13 ++-----------
js/ui/status/power.js | 8 +-------
js/ui/status/rfkill.js | 3 +--
7 files changed, 7 insertions(+), 42 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 77f44c8..af7acb8 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -697,7 +697,6 @@ const AggregateMenu = new Lang.Class({
this.menu.addMenuItem(this._location.menu);
this.menu.addMenuItem(this._rfkill.menu);
this.menu.addMenuItem(this._power.menu);
- this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addMenuItem(this._system.menu);
},
});
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 404e681..c10be71 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -1059,11 +1059,6 @@ const PopupSubMenuMenuItem = new Lang.Class({
let expander = new St.Bin({ style_class: 'popup-menu-item-expander' });
this.actor.add(expander, { expand: true });
- this.status = new St.Label({ style_class: 'popup-status-menu-item',
- y_expand: true,
- y_align: Clutter.ActorAlign.CENTER });
- this.actor.add_child(this.status);
-
this._triangle = arrowIcon(St.Side.RIGHT);
this._triangle.pivot_point = new Clutter.Point({ x: 0.5, y: 0.6 });
diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js
index 7fe6635..ada4ad5 100644
--- a/js/ui/status/bluetooth.js
+++ b/js/ui/status/bluetooth.js
@@ -101,8 +101,8 @@ const Indicator = new Lang.Class({
this._item.actor.visible = this._proxy.BluetoothHasAirplaneMode &&
!this._proxy.BluetoothAirplaneMode;
if (nDevices > 0)
- this._item.status.text = ngettext("%d Connected Device", "%d Connected Devices",
nDevices).format(nDevices);
+ this._item.label.text = ngettext("%d Connected Device", "%d Connected Devices",
nDevices).format(nDevices);
else
- this._item.status.text = _("Not Connected");
+ this._item.label.text = _("Not Connected");
},
});
diff --git a/js/ui/status/location.js b/js/ui/status/location.js
index 26a2a22..2afc0bd 100644
--- a/js/ui/status/location.js
+++ b/js/ui/status/location.js
@@ -68,7 +68,7 @@ const Indicator = new Lang.Class({
this._agent = Gio.DBusExportedObject.wrapJSObject(AgentIface, this);
this._agent.export(Gio.DBus.system, '/org/freedesktop/GeoClue2/Agent');
- this._item.status.text = _("Enabled");
+ this._item.label.text = _("Location Services in Use");
this._onOffAction = this._item.menu.addAction(_("Disable"), Lang.bind(this, this._onOnOffAction));
this._item.menu.addSettingsAction(_("Privacy Settings"), 'gnome-privacy-panel.desktop');
@@ -112,7 +112,6 @@ const Indicator = new Lang.Class({
this._indicator.visible = this._proxy.InUse;
this._item.actor.visible = this._indicator.visible;
- this._updateMenuLabels();
},
_connectToGeoclue: function() {
@@ -171,19 +170,7 @@ const Indicator = new Lang.Class({
this.menu.setSensitive(sensitive);
},
- _updateMenuLabels: function() {
- if (this._settings.get_boolean(ENABLED)) {
- this._item.status.text = this._indicator.visible ? _("In Use") : _("Enabled");
- this._onOffAction.label.text = _("Disable");
- } else {
- this._item.status.text = _("Disabled");
- this._onOffAction.label.text = _("Enable");
- }
- },
-
_onMaxAccuracyLevelChanged: function() {
- this._updateMenuLabels();
-
// Gotta ensure geoclue is up and we are registered as agent to it
// before we emit the notify for this property change.
if (!this._connectToGeoclue())
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 35b459b..9b28736 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -257,16 +257,8 @@ const NMConnectionSection = new Lang.Class({
this._radioSection.actor.visible = (nItems > 1);
this._labelSection.actor.visible = (nItems == 1);
- this.item.status.text = this._getStatus();
+ this.item.label.text = this._getStatus();
this.item.icon.icon_name = this._getMenuIcon();
-
- // desc can be undefined at cold-plug, before we called
- // NMGtk.disambiguate_device_names() at least once
- let desc = this._getDescription();
- if (desc)
- this.item.label.text = desc;
- else
- this.item.label.text = '';
},
_getMenuIcon: function() {
@@ -1282,9 +1274,8 @@ const NMDeviceWireless = new Lang.Class({
this._toggleItem.label.text = this._client.wireless_enabled ? _("Turn Off") : _("Turn On");
this._toggleItem.actor.visible = this._client.wireless_hardware_enabled;
- this.item.status.text = this._getStatus();
this.item.icon.icon_name = this._getMenuIcon();
- this.item.label.text = this._description;
+ this.item.label.text = this._getStatus();
},
setDeviceDescription: function(desc) {
diff --git a/js/ui/status/power.js b/js/ui/status/power.js
index 2a98dcc..e226de0 100644
--- a/js/ui/status/power.js
+++ b/js/ui/status/power.js
@@ -112,12 +112,6 @@ const Indicator = new Lang.Class({
this._item.icon.icon_name = icon;
// The status label
- this._item.status.text = this._getStatus();
-
- // The sub-menu heading
- if (this._proxy.Type == UPower.DeviceKind.UPS)
- this._item.label.text = _("UPS");
- else
- this._item.label.text = _("Battery");
+ this._item.label.text = this._getStatus();
},
});
diff --git a/js/ui/status/rfkill.js b/js/ui/status/rfkill.js
index e2a5720..b5470f5 100644
--- a/js/ui/status/rfkill.js
+++ b/js/ui/status/rfkill.js
@@ -85,9 +85,8 @@ const Indicator = new Lang.Class({
// The menu only appears when airplane mode is on, so just
// statically build it as if it was on, rather than dynamically
// changing the menu contents.
- this._item = new PopupMenu.PopupSubMenuMenuItem(_("Airplane Mode"), true);
+ this._item = new PopupMenu.PopupSubMenuMenuItem(_("Airplane Mode On"), true);
this._item.icon.icon_name = 'airplane-mode-symbolic';
- this._item.status.text = _("On");
this._offItem = this._item.menu.addAction(_("Turn Off"), Lang.bind(this, function() {
this._manager.airplaneMode = false;
}));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]