Commit b00e5316 authored by Milan Crha's avatar Milan Crha

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.

!119
parent b1c1b011
Pipeline #170972 passed with stages
in 1 minute and 34 seconds
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment