aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-22 14:12:58 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-23 09:44:39 -0800
commit83acb98886840550e3ee7ad57db01a29a2743a75 (patch)
tree8a897f97872efa4d61060dadfe9346d49cd9dc82 /mobile-widgets
parentee0ca3995ea826daa681289b9c308ea7a42e548e (diff)
downloadsubsurface-83acb98886840550e3ee7ad57db01a29a2743a75.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/TemplateComboBox.qml9
1 files changed, 6 insertions, 3 deletions
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 {