subsurface/mobile-widgets/qml/TemplateSlimComboBox.qml
Dirk Hohndel 74bb2c49bf 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>
2021-01-19 12:35:29 -08:00

22 lines
637 B
QML

// SPDX-License-Identifier: GPL-2.0
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.11
import org.kde.kirigami 2.4 as Kirigami
TemplateComboBox {
id: cb
Layout.fillWidth: false
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
Layout.minimumWidth: Kirigami.Units.gridUnit * 8
contentItem: Text {
text: cb.displayText
font.pointSize: subsurfaceTheme.regularPointSize
anchors.right: indicator.left
anchors.left: cb.left
color: subsurfaceTheme.textColor
leftPadding: Kirigami.Units.smallSpacing * 0.5
rightPadding: Kirigami.Units.smallSpacing * 0.5
verticalAlignment: Text.AlignVCenter
}
}