aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/SpinBox.qml
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-05-23 16:23:16 +0200
committerJani Heikkinen <jani.heikkinen@qt.io>2016-05-24 11:53:52 +0000
commit53eefecbaf24077367de12410d1a76a9c0ac1819 (patch)
tree5a7f8189acdba191674d55afec737b4aff0f4d36 /src/imports/controls/SpinBox.qml
parent13786e848c102355829f4beb9112c72e46bd9a25 (diff)
SpinBox: disable up and down indicators when appropriate
Change-Id: I6fbfde582723632c9b955a6e7ee380179b7b6a32 Task-number: QTBUG-53519 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/controls/SpinBox.qml')
-rw-r--r--src/imports/controls/SpinBox.qml9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/imports/controls/SpinBox.qml b/src/imports/controls/SpinBox.qml
index 93db1c8e..89853116 100644
--- a/src/imports/controls/SpinBox.qml
+++ b/src/imports/controls/SpinBox.qml
@@ -53,7 +53,6 @@ T.SpinBox {
padding: 6
leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0))
rightPadding: padding + (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0))
- opacity: control.enabled ? 1 : 0.3
//! [validator]
validator: IntValidator {
@@ -67,6 +66,7 @@ T.SpinBox {
contentItem: TextInput {
z: 2
text: control.textFromValue(control.value, control.locale)
+ opacity: control.enabled ? 1 : 0.3
font: control.font
color: "#353637"
@@ -105,14 +105,14 @@ T.SpinBox {
y: (parent.height - height) / 2
width: parent.width / 3
height: 2
- color: control.enabled ? "#353637" : "#bdbebf"
+ color: enabled ? "#353637" : "#bdbebf"
}
Rectangle {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
width: 2
height: parent.width / 3
- color: control.enabled ? "#353637" : "#bdbebf"
+ color: enabled ? "#353637" : "#bdbebf"
}
}
//! [up.indicator]
@@ -130,13 +130,14 @@ T.SpinBox {
y: (parent.height - height) / 2
width: parent.width / 3
height: 2
- color: control.enabled ? "#353637" : "#bdbebf"
+ color: enabled ? "#353637" : "#bdbebf"
}
}
//! [down.indicator]
//! [background]
background: Rectangle {
+ opacity: control.enabled ? 1 : 0.3
implicitWidth: 140
border.color: "#e0e0e0"
}