Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/SpinBox.qml
Show All 16 Lines | |||||
17 | * the packaging of this file. Please review the following information to | 17 | * the packaging of this file. Please review the following information to | ||
18 | * ensure the GNU General Public License version 2.0 requirements will be | 18 | * ensure the GNU General Public License version 2.0 requirements will be | ||
19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | 19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | 22 | | |||
23 | import QtQuick 2.6 | 23 | import QtQuick 2.6 | ||
24 | import QtQuick.Templates 2.0 as T | 24 | import QtQuick.Templates 2.0 as T | ||
25 | import org.kde.kirigami 2.2 as Kirigami | ||||
25 | import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate | 26 | import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate | ||
26 | 27 | | |||
27 | T.SpinBox { | 28 | T.SpinBox { | ||
28 | id: controlRoot | 29 | id: controlRoot | ||
30 | Kirigami.Theme.colorSet: Kirigami.Theme.View | ||||
31 | Kirigami.Theme.inherit: false | ||||
29 | 32 | | |||
30 | implicitWidth: Math.max(48, contentItem.implicitWidth + 2 * padding + up.indicator.implicitWidth) | 33 | implicitWidth: Math.max(48, contentItem.implicitWidth + 2 * padding + up.indicator.implicitWidth) | ||
31 | implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding | 34 | implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding | ||
32 | 35 | | |||
33 | padding: 6 | 36 | padding: 6 | ||
34 | leftPadding: padding + (controlRoot.mirrored ? (up.indicator ? up.indicator.width : 0) : 0) | 37 | leftPadding: padding + (controlRoot.mirrored ? (up.indicator ? up.indicator.width : 0) : 0) | ||
35 | rightPadding: padding + (controlRoot.mirrored ? 0 : (up.indicator ? up.indicator.width : 0)) | 38 | rightPadding: padding + (controlRoot.mirrored ? 0 : (up.indicator ? up.indicator.width : 0)) | ||
36 | 39 | | |||
37 | 40 | | |||
38 | hoverEnabled: true | 41 | hoverEnabled: true | ||
39 | 42 | | |||
40 | validator: IntValidator { | 43 | validator: IntValidator { | ||
41 | locale: controlRoot.locale.name | 44 | locale: controlRoot.locale.name | ||
42 | bottom: Math.min(controlRoot.from, controlRoot.to) | 45 | bottom: Math.min(controlRoot.from, controlRoot.to) | ||
43 | top: Math.max(controlRoot.from, controlRoot.to) | 46 | top: Math.max(controlRoot.from, controlRoot.to) | ||
44 | } | 47 | } | ||
45 | 48 | | |||
46 | contentItem: TextInput { | 49 | contentItem: TextInput { | ||
47 | z: 2 | 50 | z: 2 | ||
48 | text: controlRoot.textFromValue(controlRoot.value, controlRoot.locale) | 51 | text: controlRoot.textFromValue(controlRoot.value, controlRoot.locale) | ||
49 | opacity: controlRoot.enabled ? 1 : 0.3 | 52 | opacity: controlRoot.enabled ? 1 : 0.3 | ||
50 | 53 | | |||
51 | font: controlRoot.font | 54 | font: controlRoot.font | ||
52 | color: StylePrivate.SystemPaletteSingleton.text(controlRoot.enabled) | 55 | color: Kirigami.Theme.textColor | ||
53 | selectionColor: StylePrivate.SystemPaletteSingleton.highlight(controlRoot.enabled) | 56 | selectionColor: Kirigami.Theme.highlightColor | ||
54 | selectedTextColor: StylePrivate.SystemPaletteSingleton.highlightedText(controlRoot.enabled) | 57 | selectedTextColor: Kirigami.Theme.highlightedTextColor | ||
55 | horizontalAlignment: Qt.AlignHCenter | 58 | horizontalAlignment: Qt.AlignHCenter | ||
56 | verticalAlignment: Qt.AlignVCenter | 59 | verticalAlignment: Qt.AlignVCenter | ||
57 | 60 | | |||
58 | readOnly: !controlRoot.editable | 61 | readOnly: !controlRoot.editable | ||
59 | validator: controlRoot.validator | 62 | validator: controlRoot.validator | ||
60 | inputMethodHints: Qt.ImhFormattedNumbersOnly | 63 | inputMethodHints: Qt.ImhFormattedNumbersOnly | ||
61 | 64 | | |||
62 | MouseArea { | 65 | MouseArea { | ||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |