From f84d05e5148e98fa450cebe8ee8a80ff2a00fc91 Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Mon, 2 May 2022 21:30:02 +0200 Subject: [PATCH] Fix menu lock bug with no choices --- qml/components/ChoiceSetting.qml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/qml/components/ChoiceSetting.qml b/qml/components/ChoiceSetting.qml index cc8df87..1d8e28f 100644 --- a/qml/components/ChoiceSetting.qml +++ b/qml/components/ChoiceSetting.qml @@ -14,7 +14,11 @@ Setting { displayValue: Utils.ippName(name, choice != undefined ? choice : default_choice, strings) onClicked: { - if(actual_choices.length>num_large_choices) + if(hasMenu) + { + menu.open(this) + } + else if(actual_choices.length != 0) { var dialog = pageStack.push("LargeChoiceDialog.qml", {name:name, choice: choice != undefined ? choice : default_choice, choices: actual_choices, @@ -24,10 +28,6 @@ Setting { choice = dialog.choice }) } - else - { - menu.open(this) - } } menu: ContextMenu { @@ -45,7 +45,5 @@ Setting { } - hasMenu: !actual_choices.length>num_large_choices - - + hasMenu: actual_choices.length != 0 && (actual_choices.length <= num_large_choices) }