From 83acb98886840550e3ee7ad57db01a29a2743a75 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 22 Dec 2020 14:12:58 -0800 Subject: mobile UI: make TemplateComboBox selectively editable Getting the visual right is really hard. The anchors seem to mostly work, but it still doesn't look exactly right, IMHO. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/TemplateComboBox.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/TemplateComboBox.qml b/mobile-widgets/qml/TemplateComboBox.qml index 3721aa77b..6ecf80bac 100644 --- a/mobile-widgets/qml/TemplateComboBox.qml +++ b/mobile-widgets/qml/TemplateComboBox.qml @@ -46,14 +46,16 @@ ComboBox { } } - contentItem: Text { + contentItem: TextField { + readOnly: !cb.editable + anchors.right: indicator.left + anchors.left: cb.left leftPadding: Kirigami.Units.smallSpacing - rightPadding: cb.indicator.width + cb.spacing + rightPadding: Kirigami.Units.smallSpacing text: cb.displayText font: cb.font color: subsurfaceTheme.textColor verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight } background: Rectangle { @@ -61,6 +63,7 @@ ComboBox { border.width: cb.visualFocus ? 2 : 1 color: subsurfaceTheme.backgroundColor radius: 2 + visible: cb.focus } popup: Popup { -- cgit v1.2.3-70-g09d2