[gnome-shell-extensions/wip/mcrha/windowlist-prefs-radio] window-list: Invalid current mode selected in Preferences
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions/wip/mcrha/windowlist-prefs-radio] window-list: Invalid current mode selected in Preferences
- Date: Fri, 17 Apr 2020 07:34:33 +0000 (UTC)
commit b00e531626598fa59d3c1865f453e30fdba5648f
Author: Milan Crha <mcrha redhat com>
Date: Fri Apr 17 09:21:42 2020 +0200
window-list: Invalid current mode selected in Preferences
It seems that gtk+ resets the active radio whenever a new radio button
is added into the group, thus rather restore the current mode after
the group is fully populated.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/119
extensions/window-list/prefs.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js
index 82bc59e..a8e9146 100644
--- a/extensions/window-list/prefs.js
+++ b/extensions/window-list/prefs.js
@@ -50,6 +50,7 @@ class WindowListPrefsWidget extends Gtk.Grid {
};
let radio = null;
+ let currentRadio = null;
for (let i = 0; i < modes.length; i++) {
let mode = modes[i];
let label = modeLabels[mode];
@@ -59,18 +60,24 @@ class WindowListPrefsWidget extends Gtk.Grid {
}
radio = new Gtk.RadioButton({
- active: currentMode === mode,
+ active: !i,
label,
group: radio,
});
grid.add(radio);
+ if (currentMode === mode)
+ currentRadio = radio;
+
radio.connect('toggled', button => {
if (button.active)
this._settings.set_string('grouping-mode', mode);
});
}
+ if (currentRadio)
+ currentRadio.active = true;
+
let check = new Gtk.CheckButton({
label: _('Show on all monitors'),
margin_top: 6,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]