Skip to content

Commit f84d05e

Browse files
committed
Fix menu lock bug with no choices
1 parent dd19333 commit f84d05e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

qml/components/ChoiceSetting.qml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ Setting {
1414
displayValue: Utils.ippName(name, choice != undefined ? choice : default_choice, strings)
1515

1616
onClicked: {
17-
if(actual_choices.length>num_large_choices)
17+
if(hasMenu)
18+
{
19+
menu.open(this)
20+
}
21+
else if(actual_choices.length != 0)
1822
{
1923
var dialog = pageStack.push("LargeChoiceDialog.qml",
2024
{name:name, choice: choice != undefined ? choice : default_choice, choices: actual_choices,
@@ -24,10 +28,6 @@ Setting {
2428
choice = dialog.choice
2529
})
2630
}
27-
else
28-
{
29-
menu.open(this)
30-
}
3131
}
3232

3333
menu: ContextMenu {
@@ -45,7 +45,5 @@ Setting {
4545

4646
}
4747

48-
hasMenu: !actual_choices.length>num_large_choices
49-
50-
48+
hasMenu: actual_choices.length != 0 && (actual_choices.length <= num_large_choices)
5149
}

0 commit comments

Comments
 (0)