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 }
|
||||
|
||||
ColumnLayout {
|
||||
Repeater {
|
||||
model: playbackRateModel
|
||||
// Using instantiator because using Repeater made the separator show up in
|
||||
// the wrong place
|
||||
Instantiator {
|
||||
model: playbackRateModel
|
||||
|
||||
Controls.RadioButton {
|
||||
padding: Kirigami.Units.smallSpacing
|
||||
text: model.value
|
||||
checked: model.value === AudioManager.playbackRate.toFixed(2)
|
||||
Controls.ButtonGroup.group: playbackRateGroup
|
||||
Controls.MenuItem {
|
||||
text: model.value
|
||||
checkable: true
|
||||
checked: model.value === AudioManager.playbackRate.toFixed(2)
|
||||
Controls.ButtonGroup.group: playbackRateGroup
|
||||
|
||||
onToggled: {
|
||||
if (checked) {
|
||||
AudioManager.playbackRate = value;
|
||||
}
|
||||
playbackRateMenu.dismiss();
|
||||
onTriggered: {
|
||||
if (checked) {
|
||||
AudioManager.playbackRate = value;
|
||||
}
|
||||
playbackRateMenu.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
onObjectAdded: playbackRateMenu.insertItem(index, object)
|
||||
onObjectRemoved: playbackRateMenu.removeItem(object)
|
||||
}
|
||||
|
||||
Controls.MenuSeparator {
|
||||
|
|
|
@ -133,13 +133,13 @@ Controls.Control {
|
|||
Repeater {
|
||||
model: filterModel
|
||||
|
||||
Controls.RadioButton {
|
||||
padding: Kirigami.Units.smallSpacing
|
||||
Controls.MenuItem {
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.filterType === proxyModel.filterType
|
||||
Controls.ButtonGroup.group: filterGroup
|
||||
|
||||
onToggled: {
|
||||
onTriggered: {
|
||||
if (checked) {
|
||||
proxyModel.filterType = model.filterType;
|
||||
}
|
||||
|
@ -182,11 +182,11 @@ Controls.Control {
|
|||
Repeater {
|
||||
model: searchSettingsModel
|
||||
|
||||
Controls.CheckBox {
|
||||
padding: Kirigami.Units.smallSpacing
|
||||
Controls.MenuItem {
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.checked
|
||||
onToggled: {
|
||||
onTriggered: {
|
||||
if (checked) {
|
||||
proxyModel.searchFlags = proxyModel.searchFlags | model.searchFlag;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue