Skip to content

Commit

Permalink
Fix pulley going disabled with big ChoiceSettings
Browse files Browse the repository at this point in the history
If ChoiceSetting uses the LargeChoiceDialog, it would leak an open
empty ContextMenu, which blocks usage of the PullDownMenu.
Add a hasMenu attribute to conditionally not open it.
  • Loading branch information
attah committed Jan 2, 2021
1 parent dab0e0e commit 731db2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions qml/components/ChoiceSetting.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ Setting {

}

hasMenu: !limited_choices.length>num_large_choices


}
11 changes: 9 additions & 2 deletions qml/components/Setting.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import Sailfish.Silica 1.0

Item {
height: button.height + menu.height
height: button.height + (menu != undefined ? menu.height : 0)
width: parent.width

property string name
Expand All @@ -14,7 +14,12 @@ Item {
property var default_choice

signal clicked()
onClicked: menu.open(this)
onClicked: {
if (hasMenu)
{
menu.open(this)
}
}

property alias displayValue: button.value

Expand All @@ -24,6 +29,8 @@ Item {
label: prettyName
onClicked: parent.clicked()
}

property var menu
property bool hasMenu: true

}

0 comments on commit 731db2d

Please sign in to comment.