window-list: Switch to Adw.SwitchRow

libadwaita fixed the actionable implementation of Adw.SwitchRow,
so can use the convenience widget instead of composing our own.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/341>
This commit is contained in:
Florian Müllner
2024-10-01 14:55:44 +02:00
committed by Marge Bot
parent 0162644041
commit 548d7659e1

View File

@@ -60,37 +60,22 @@ class WindowListPrefsWidget extends Adw.PreferencesPage {
const miscGroup = new Adw.PreferencesGroup();
this.add(miscGroup);
let toggle = new Gtk.Switch({
action_name: 'window-list.show-on-all-monitors',
valign: Gtk.Align.CENTER,
});
let row = new Adw.ActionRow({
let row = new Adw.SwitchRow({
title: _('Show on all monitors'),
activatable_widget: toggle,
action_name: 'window-list.show-on-all-monitors',
});
row.add_suffix(toggle);
miscGroup.add(row);
toggle = new Gtk.Switch({
action_name: 'window-list.display-all-workspaces',
valign: Gtk.Align.CENTER,
});
row = new Adw.ActionRow({
row = new Adw.SwitchRow({
title: _('Show windows from all workspaces'),
activatable_widget: toggle,
action_name: 'window-list.display-all-workspaces',
});
row.add_suffix(toggle);
miscGroup.add(row);
toggle = new Gtk.Switch({
action_name: 'window-list.embed-previews',
valign: Gtk.Align.CENTER,
});
row = new Adw.ActionRow({
row = new Adw.SwitchRow({
title: _('Show workspace previews'),
activatable_widget: toggle,
action_name: 'window-list.embed-previews',
});
row.add_suffix(toggle);
miscGroup.add(row);
}
}