summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/TemplateComboBox.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-15 12:27:58 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-19 12:35:29 -0800
commit74bb2c49bff69dc622f3faa653623d4882b59af5 (patch)
treea9e97d464d54afc73c7318a4813375c78a055dc7 /mobile-widgets/qml/TemplateComboBox.qml
parent9aa660e06ea83fa78d68266663b2a12d4c8f1d6d (diff)
downloadsubsurface-74bb2c49bff69dc622f3faa653623d4882b59af5.tar.gz
mobile/UI: improve layout of styled ComboBox and TextField
This makes the TextFields (and the editable ComboBoxes with them) have a tighter visual experience. It also moves the indicater closer to the right edge in the ComboBox and doesn't use preferredWidth for the slim combo box as that implies a maximum width which could lead to unnecessary clipping. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/TemplateComboBox.qml')
-rw-r--r--mobile-widgets/qml/TemplateComboBox.qml6
1 files changed, 5 insertions, 1 deletions
diff --git a/mobile-widgets/qml/TemplateComboBox.qml b/mobile-widgets/qml/TemplateComboBox.qml
index 82b5fbf9f..10ffdb93e 100644
--- a/mobile-widgets/qml/TemplateComboBox.qml
+++ b/mobile-widgets/qml/TemplateComboBox.qml
@@ -6,10 +6,12 @@ import org.kde.kirigami 2.4 as Kirigami
ComboBox {
id: cb
+ editable: false
Layout.fillWidth: true
- Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
+ Layout.preferredHeight: Kirigami.Units.gridUnit * 2.0
inputMethodHints: Qt.ImhNoPredictiveText
font.pointSize: subsurfaceTheme.regularPointSize
+ rightPadding: Kirigami.Units.smallSpacing
property var flickable // used to ensure the combobox is visible on screen
delegate: ItemDelegate {
width: cb.width
@@ -49,6 +51,7 @@ ComboBox {
}
contentItem: SsrfTextField {
+ inComboBox: cb.editable
readOnly: !cb.editable
anchors.right: indicator.left
anchors.left: cb.left
@@ -59,6 +62,7 @@ ComboBox {
font: cb.font
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
+
onPressed: {
if (readOnly) {
if (cb.popup.opened) {