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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>
This commit is contained in:
parent
2f8a2c3166
commit
6a3dfbee8b
@ -359,11 +359,6 @@ class NMConnectionItem extends NMMenuItem {
|
|||||||
this._sync();
|
this._sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateOrnament() {
|
|
||||||
this.setOrnament(this.radio_mode && this.is_active
|
|
||||||
? PopupMenu.Ornament.DOT : PopupMenu.Ornament.NONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
_getAccessibleName() {
|
_getAccessibleName() {
|
||||||
return this.is_active
|
return this.is_active
|
||||||
// Translators: %s is a device name like "MyPhone"
|
// Translators: %s is a device name like "MyPhone"
|
||||||
@ -383,12 +378,14 @@ class NMConnectionItem extends NMMenuItem {
|
|||||||
this._subtitle.text = null;
|
this._subtitle.text = null;
|
||||||
this.accessible_name = this.name;
|
this.accessible_name = this.name;
|
||||||
this.accessible_role = Atk.Role.CHECK_MENU_ITEM;
|
this.accessible_role = Atk.Role.CHECK_MENU_ITEM;
|
||||||
|
this.setOrnament(this.is_active
|
||||||
|
? PopupMenu.Ornament.DOT : PopupMenu.Ornament.NONE);
|
||||||
} else {
|
} else {
|
||||||
this.accessible_name = this._getAccessibleName();
|
this.accessible_name = this._getAccessibleName();
|
||||||
this._subtitle.text = this._getSubtitleLabel();
|
this._subtitle.text = this._getSubtitleLabel();
|
||||||
this.accessible_role = Atk.Role.MENU_ITEM;
|
this.accessible_role = Atk.Role.MENU_ITEM;
|
||||||
|
this.setOrnament(PopupMenu.Ornament.HIDDEN);
|
||||||
}
|
}
|
||||||
this._updateOrnament();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
activate() {
|
activate() {
|
||||||
|
Loading…
Reference in New Issue
Block a user