From 6a3dfbee8b21d744db3e7824a0bed3d72bfa6f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 13 Jul 2023 19:03:08 +0200 Subject: [PATCH] status/network: Only show ornament in radio-mode Soon only radio items should use a visible ornament, to avoid unnecessary extra margins in regular items. Network items can act as both radio- and regular items, so update the ornament accordingly. Part-of: --- js/ui/status/network.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index d73b37cea..000279e85 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -359,11 +359,6 @@ class NMConnectionItem extends NMMenuItem { this._sync(); } - _updateOrnament() { - this.setOrnament(this.radio_mode && this.is_active - ? PopupMenu.Ornament.DOT : PopupMenu.Ornament.NONE); - } - _getAccessibleName() { return this.is_active // Translators: %s is a device name like "MyPhone" @@ -383,12 +378,14 @@ class NMConnectionItem extends NMMenuItem { this._subtitle.text = null; this.accessible_name = this.name; this.accessible_role = Atk.Role.CHECK_MENU_ITEM; + this.setOrnament(this.is_active + ? PopupMenu.Ornament.DOT : PopupMenu.Ornament.NONE); } else { this.accessible_name = this._getAccessibleName(); this._subtitle.text = this._getSubtitleLabel(); this.accessible_role = Atk.Role.MENU_ITEM; + this.setOrnament(PopupMenu.Ornament.HIDDEN); } - this._updateOrnament(); } activate() {