status/bluetooth: Show bluetooth-disabled icon when disabled

We have an icon for this, so let's actually use it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2186

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2198>
This commit is contained in:
Jonas Dreßler 2022-02-18 21:02:20 +01:00 committed by Marge Bot
parent 24143eae0d
commit 8a7f935969

View File

@ -41,7 +41,6 @@ class Indicator extends PanelMenu.SystemIndicator {
this._proxy.connect('g-properties-changed', this._queueSync.bind(this)); this._proxy.connect('g-properties-changed', this._queueSync.bind(this));
this._item = new PopupMenu.PopupSubMenuMenuItem(_("Bluetooth"), true); this._item = new PopupMenu.PopupSubMenuMenuItem(_("Bluetooth"), true);
this._item.icon.icon_name = 'bluetooth-active-symbolic';
this._toggleItem = new PopupMenu.PopupMenuItem(''); this._toggleItem = new PopupMenu.PopupMenuItem('');
this._toggleItem.connect('activate', () => { this._toggleItem.connect('activate', () => {
@ -159,6 +158,9 @@ class Indicator extends PanelMenu.SystemIndicator {
else else
this._item.visible = adapterPowered; this._item.visible = adapterPowered;
this._item.icon.icon_name = adapterPowered
? 'bluetooth-active-symbolic' : 'bluetooth-disabled-symbolic';
if (nConnectedDevices > 1) if (nConnectedDevices > 1)
/* Translators: this is the number of connected bluetooth devices */ /* Translators: this is the number of connected bluetooth devices */
this._item.label.text = ngettext('%d Connected', '%d Connected', nConnectedDevices).format(nConnectedDevices); this._item.label.text = ngettext('%d Connected', '%d Connected', nConnectedDevices).format(nConnectedDevices);