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:
Florian Müllner 2022-07-30 00:06:49 +02:00 committed by Marge Bot
parent a0436d4b48
commit 3ce3034fdd
2 changed files with 13 additions and 0 deletions

View File

@ -35,6 +35,8 @@
border-radius: 999px; border-radius: 999px;
padding: 1.5 * $base_padding; padding: 1.5 * $base_padding;
background-color: lighten($bg_color, 10%); background-color: lighten($bg_color, 10%);
&.active { background-color: $selected_bg_color; }
} }
& .title { & .title {

View File

@ -154,6 +154,10 @@ class QuickToggleMenu extends PopupMenu.PopupMenuBase {
this._headerTitle, side, 1, 1); this._headerTitle, side, 1, 1);
headerLayout.attach_next_to(this._headerSubtitle, headerLayout.attach_next_to(this._headerSubtitle,
this._headerTitle, Clutter.GridPosition.BOTTOM, 1, 1); this._headerTitle, Clutter.GridPosition.BOTTOM, 1, 1);
sourceActor.connect('notify::checked',
() => this._syncChecked());
this._syncChecked();
} }
setHeader(icon, title, subtitle = '') { setHeader(icon, title, subtitle = '') {
@ -238,6 +242,13 @@ class QuickToggleMenu extends PopupMenu.PopupMenuBase {
this.emit('open-state-changed', false); 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 // expected on toplevel menus
_setOpenedSubMenu(submenu) { _setOpenedSubMenu(submenu) {
this._openedSubMenu?.close(true); this._openedSubMenu?.close(true);