quickSettings: Color header icon if checked
... as requested by the design team. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2393>
This commit is contained in:
parent
a0436d4b48
commit
3ce3034fdd
@ -35,6 +35,8 @@
|
||||
border-radius: 999px;
|
||||
padding: 1.5 * $base_padding;
|
||||
background-color: lighten($bg_color, 10%);
|
||||
|
||||
&.active { background-color: $selected_bg_color; }
|
||||
}
|
||||
|
||||
& .title {
|
||||
|
@ -154,6 +154,10 @@ class QuickToggleMenu extends PopupMenu.PopupMenuBase {
|
||||
this._headerTitle, side, 1, 1);
|
||||
headerLayout.attach_next_to(this._headerSubtitle,
|
||||
this._headerTitle, Clutter.GridPosition.BOTTOM, 1, 1);
|
||||
|
||||
sourceActor.connect('notify::checked',
|
||||
() => this._syncChecked());
|
||||
this._syncChecked();
|
||||
}
|
||||
|
||||
setHeader(icon, title, subtitle = '') {
|
||||
@ -238,6 +242,13 @@ class QuickToggleMenu extends PopupMenu.PopupMenuBase {
|
||||
this.emit('open-state-changed', false);
|
||||
}
|
||||
|
||||
_syncChecked() {
|
||||
if (this.sourceActor.checked)
|
||||
this._headerIcon.add_style_class_name('active');
|
||||
else
|
||||
this._headerIcon.remove_style_class_name('active');
|
||||
}
|
||||
|
||||
// expected on toplevel menus
|
||||
_setOpenedSubMenu(submenu) {
|
||||
this._openedSubMenu?.close(true);
|
||||
|
Loading…
Reference in New Issue
Block a user