mobile/UI: open dropdown on any tap for readonly combo box

This seems more intuitive. For editable combo boxes you need to tap on
the indicator, but for non-editable (readonly) ones, you can tap
anywhere and the dropdown is shown.
The code feels a bit clumsy, but seems to work in all cases.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-12-22 16:23:12 -08:00
parent bda1f0b6e1
commit 336decd30c

View file

@ -57,6 +57,15 @@ ComboBox {
font: cb.font
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
onPressed: {
if (readOnly) {
if (cb.popup.opened) {
cb.popup.close()
} else {
cb.popup.open()
}
}
}
}
background: Rectangle {