summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-22 16:23:12 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-23 09:44:39 -0800
commit336decd30c8614b9778051c79f457421e4baf3e7 (patch)
tree17721ae6b0b7d82265af0fa92fc1fcb66a6add39
parentbda1f0b6e1c8c91fb5a486374759e783b5e5f03b (diff)
downloadsubsurface-336decd30c8614b9778051c79f457421e4baf3e7.tar.gz
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>
-rw-r--r--mobile-widgets/qml/TemplateComboBox.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/mobile-widgets/qml/TemplateComboBox.qml b/mobile-widgets/qml/TemplateComboBox.qml
index bd2a81d63..e51c7d060 100644
--- a/mobile-widgets/qml/TemplateComboBox.qml
+++ b/mobile-widgets/qml/TemplateComboBox.qml
@@ -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 {