Verified Commit 4d835be8 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

[applets/pager] Fix button group management on configuration page

More declarative and centralized approach fixes the case when the "Text
display:" section may have no radio buttons selected.

Amends c50e4b98.

BUG: 456525
FIXED-IN: 5.24.7 5.25.4 5.26
parent 85ca73d9
Pipeline #204275 passed with stage
in 5 minutes and 34 seconds
......@@ -25,39 +25,6 @@ Kirigami.FormLayout {
property alias cfg_showOnlyCurrentScreen: showOnlyCurrentScreen.checked
property alias cfg_wrapPage: wrapPage.checked
onCfg_displayedTextChanged: {
switch (cfg_displayedText) {
case 0:
displayedTextGroup.checkedButton = desktopNumberRadio;
break;
case 1:
displayedTextGroup.checkedButton = desktopNameRadio;
break;
default:
case 2:
displayedTextGroup.checkedButton = noTextRadio;
break;
}
}
onCfg_currentDesktopSelectedChanged: {
switch (cfg_currentDesktopSelected) {
case 0:
currentDesktopSelectedGroup.checkedButton = doesNothingRadio;
break;
case 1:
currentDesktopSelectedGroup.checkedButton = showsDesktopRadio;
break;
default:
break;
}
}
Component.onCompleted: {
cfg_currentDesktopSelectedChanged();
cfg_displayedTextChanged();
}
QQC2.ButtonGroup {
id: displayedTextGroup
}
......@@ -114,21 +81,24 @@ Kirigami.FormLayout {
QQC2.ButtonGroup.group: displayedTextGroup
text: i18n("No text")
onCheckedChanged: if (checked) cfg_displayedText = 2;
checked: cfg_displayedText === 2
onToggled: if (checked) cfg_displayedText = 2;
}
QQC2.RadioButton {
id: desktopNumberRadio
QQC2.ButtonGroup.group: displayedTextGroup
text: isActivityPager ? i18n("Activity number") : i18n("Desktop number")
onCheckedChanged: if (checked) cfg_displayedText = 0;
checked: cfg_displayedText === 0
onToggled: if (checked) cfg_displayedText = 0;
}
QQC2.RadioButton {
id: desktopNameRadio
QQC2.ButtonGroup.group: displayedTextGroup
text: isActivityPager ? i18n("Activity name") : i18n("Desktop name")
onCheckedChanged: if (checked) cfg_displayedText = 1;
checked: cfg_displayedText === 1
onToggled: if (checked) cfg_displayedText = 1;
}
......@@ -144,13 +114,15 @@ Kirigami.FormLayout {
QQC2.ButtonGroup.group: currentDesktopSelectedGroup
text: i18n("Does nothing")
onCheckedChanged: if (checked) cfg_currentDesktopSelected = 0;
checked: cfg_currentDesktopSelected === 0
onToggled: if (checked) cfg_currentDesktopSelected = 0;
}
QQC2.RadioButton {
id: showsDesktopRadio
QQC2.ButtonGroup.group: currentDesktopSelectedGroup
text: i18n("Shows the desktop")
onCheckedChanged: if (checked) cfg_currentDesktopSelected = 1;
checked: cfg_currentDesktopSelected === 1
onToggled: if (checked) cfg_currentDesktopSelected = 1;
}
}
Supports Markdown
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