From 336decd30c8614b9778051c79f457421e4baf3e7 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 22 Dec 2020 16:23:12 -0800 Subject: [PATCH] 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 --- mobile-widgets/qml/TemplateComboBox.qml | 9 +++++++++ 1 file changed, 9 insertions(+) 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 {