5import QtQuick.Controls as QQC2
8import org.kde.kirigami as Kirigami
9import 'private' as Private
41 required property string label
46 property alias value: spinbox.value
51 property alias from: spinbox.from
56 property alias to: spinbox.to
61 property alias stepSize: spinbox.stepSize
66 property alias textFromValue: spinbox.textFromValue
71 property alias valueFromText: spinbox.valueFromText
76 property alias displayText: spinbox.displayText
81 property alias validator: spinbox.validator
98 property var status: Kirigami.MessageType.Information
103 property string statusMessage: ""
108 function increase() {
115 function decrease() {
119 focusPolicy: Kirigami.Settings.isMobile ? Qt.StrongFocus : Qt.NoFocus
121 onClicked: spinbox.forceActiveFocus()
124 contentItem: ColumnLayout {
125 spacing: Private.FormCardUnits.verticalSpacing
128 Layout.fillWidth: true
132 Layout.fillWidth: true
134 elide: Text.ElideRight
135 color: root.enabled ? Kirigami.Theme.textColor : Kirigami.Theme.disabledTextColor
141 onClicked: root.decrease()
142 icon.name: 'arrow-down'
143 visible: Kirigami.Settings.isMobile
150 focusPolicy: Qt.NoFocus
153 leftPadding: Kirigami.Units.largeSpacing * 2
154 rightPadding: Kirigami.Units.largeSpacing * 2
155 visible: Kirigami.Settings.isMobile
156 contentItem: QQC2.Label {
157 verticalAlignment: Text.AlignVCenter
158 height: Kirigami.Units.gridUnit * 2
159 text: root.textFromValue(root.value, root.locale)
162 implicitHeight: Kirigami.Units.gridUnit * 2
164 color: Kirigami.ColorUtils.linearInterpolation(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, Kirigami.Theme.frameContrast)
174 color: Kirigami.ColorUtils.linearInterpolation(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, Kirigami.Theme.frameContrast)
179 bottom: parent.bottom
186 onClicked: root.increase()
187 visible: Kirigami.Settings.isMobile
188 icon.name: 'arrow-up'
197 Layout.fillWidth: true
198 visible: !Kirigami.Settings.isMobile
202 Kirigami.InlineMessage {
204 visible: root.statusMessage.length > 0
205 Layout.topMargin: visible ?
Kirigami.Units.smallSpacing : 0
206 Layout.fillWidth:
true
207 text: root.statusMessage