mirror of https://github.com/KDE/kasts.git
Revert back to MenuItem
Up to now, RadioButton and CheckButton were added to Menus explicitly because MenuItem would not use the correct delegate (i.e. CheckButton instead of RadioButton for a selection group). Since this has been fixed in qqc2-desktop-style, we can use the proper component again.
This commit is contained in:
parent
8a9dc0f22f
commit
5026b25352
|
@ -20,24 +20,27 @@ Controls.Menu {
|
||||||
|
|
||||||
Controls.ButtonGroup { id: playbackRateGroup }
|
Controls.ButtonGroup { id: playbackRateGroup }
|
||||||
|
|
||||||
ColumnLayout {
|
// Using instantiator because using Repeater made the separator show up in
|
||||||
Repeater {
|
// the wrong place
|
||||||
|
Instantiator {
|
||||||
model: playbackRateModel
|
model: playbackRateModel
|
||||||
|
|
||||||
Controls.RadioButton {
|
Controls.MenuItem {
|
||||||
padding: Kirigami.Units.smallSpacing
|
|
||||||
text: model.value
|
text: model.value
|
||||||
|
checkable: true
|
||||||
checked: model.value === AudioManager.playbackRate.toFixed(2)
|
checked: model.value === AudioManager.playbackRate.toFixed(2)
|
||||||
Controls.ButtonGroup.group: playbackRateGroup
|
Controls.ButtonGroup.group: playbackRateGroup
|
||||||
|
|
||||||
onToggled: {
|
onTriggered: {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
AudioManager.playbackRate = value;
|
AudioManager.playbackRate = value;
|
||||||
}
|
}
|
||||||
playbackRateMenu.dismiss();
|
playbackRateMenu.dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
onObjectAdded: playbackRateMenu.insertItem(index, object)
|
||||||
|
onObjectRemoved: playbackRateMenu.removeItem(object)
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.MenuSeparator {
|
Controls.MenuSeparator {
|
||||||
|
|
|
@ -133,13 +133,13 @@ Controls.Control {
|
||||||
Repeater {
|
Repeater {
|
||||||
model: filterModel
|
model: filterModel
|
||||||
|
|
||||||
Controls.RadioButton {
|
Controls.MenuItem {
|
||||||
padding: Kirigami.Units.smallSpacing
|
|
||||||
text: model.name
|
text: model.name
|
||||||
|
checkable: true
|
||||||
checked: model.filterType === proxyModel.filterType
|
checked: model.filterType === proxyModel.filterType
|
||||||
Controls.ButtonGroup.group: filterGroup
|
Controls.ButtonGroup.group: filterGroup
|
||||||
|
|
||||||
onToggled: {
|
onTriggered: {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
proxyModel.filterType = model.filterType;
|
proxyModel.filterType = model.filterType;
|
||||||
}
|
}
|
||||||
|
@ -182,11 +182,11 @@ Controls.Control {
|
||||||
Repeater {
|
Repeater {
|
||||||
model: searchSettingsModel
|
model: searchSettingsModel
|
||||||
|
|
||||||
Controls.CheckBox {
|
Controls.MenuItem {
|
||||||
padding: Kirigami.Units.smallSpacing
|
|
||||||
text: model.name
|
text: model.name
|
||||||
|
checkable: true
|
||||||
checked: model.checked
|
checked: model.checked
|
||||||
onToggled: {
|
onTriggered: {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
proxyModel.searchFlags = proxyModel.searchFlags | model.searchFlag;
|
proxyModel.searchFlags = proxyModel.searchFlags | model.searchFlag;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue