BluetoothMenu: show the submenu when active but not connected
Following the updated designs for system status, show the submenu but not the indicator when bluetooth radio is on but no device is connected. https://bugzilla.gnome.org/show_bug.cgi?id=709353
This commit is contained in:
parent
ed53a45228
commit
aa426842f2
@ -38,7 +38,10 @@ const Indicator = new Lang.Class({
|
|||||||
log(error.message);
|
log(error.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._sync();
|
||||||
}));
|
}));
|
||||||
|
this._proxy.connect('g-properties-changed', Lang.bind(this, this._sync));
|
||||||
|
|
||||||
// The Bluetooth menu only appears when Bluetooth is in use,
|
// The Bluetooth menu only appears when Bluetooth is in use,
|
||||||
// so just statically build it with a "Turn Off" menu item.
|
// so just statically build it with a "Turn Off" menu item.
|
||||||
@ -90,11 +93,12 @@ const Indicator = new Lang.Class({
|
|||||||
_sync: function() {
|
_sync: function() {
|
||||||
let nDevices = this._getNConnectedDevices();
|
let nDevices = this._getNConnectedDevices();
|
||||||
|
|
||||||
let on = nDevices > 0;
|
this._indicator.visible = nDevices > 0;
|
||||||
this._indicator.visible = on;
|
this._item.actor.visible = !this._proxy.BluetoothAirplaneMode;
|
||||||
this._item.actor.visible = on;
|
|
||||||
|
|
||||||
if (on)
|
if (nDevices > 0)
|
||||||
this._item.status.text = ngettext("%d Connected Device", "%d Connected Devices", nDevices).format(nDevices);
|
this._item.status.text = ngettext("%d Connected Device", "%d Connected Devices", nDevices).format(nDevices);
|
||||||
|
else
|
||||||
|
this._item.status.text = _("Not Connected");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user