[gnome-shell] status/bluetooth: Show bluetooth-disabled icon when disabled



commit 8a7f93596992000942cdc1337f45ee3197376351
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Fri Feb 18 21:02:20 2022 +0100

    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>

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


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