aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/Switch.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-04-24 01:02:24 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-04-23 23:12:08 +0000
commite9476ae5b9385ce5a6b4a55f984543aa180492bd (patch)
treea08daab06213e8347f724a0e939c0b210eb357e0 /src/imports/controls/Switch.qml
parent2df3b1b930e3d151e14ace3f464b9caeadff0b04 (diff)
Use Theme.disabledColor to get sensible looks in disabled state
Change-Id: I28831c979f8fa040fc3388eec6f2256930a3d91d Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/Switch.qml')
-rw-r--r--src/imports/controls/Switch.qml11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/imports/controls/Switch.qml b/src/imports/controls/Switch.qml
index ccfdaa3c..518c07ad 100644
--- a/src/imports/controls/Switch.qml
+++ b/src/imports/controls/Switch.qml
@@ -67,7 +67,6 @@ AbstractSwitch {
radius: 10
border.width: control.activeFocus ? 2 : 1
border.color: control.activeFocus ? control.Theme.focusColor : control.Theme.frameColor
- opacity: enabled ? 1.0 : control.Theme.disabledOpacity
color: control.Theme.backgroundColor
Rectangle {
@@ -75,9 +74,10 @@ AbstractSwitch {
height: 12
radius: 6
- color: Qt.tint(Qt.tint(control.checked ? control.Theme.accentColor : control.Theme.baseColor,
- control.checked && control.activeFocus ? control.Theme.focusColor : "transparent"),
- control.pressed ? control.Theme.pressColor : "transparent")
+ color: Qt.tint(control.checked && !control.enabled ? control.Theme.disabledColor :
+ control.checked && control.activeFocus ? control.Theme.focusColor :
+ control.checked ? control.Theme.accentColor : control.Theme.baseColor,
+ control.pressed ? control.Theme.pressColor : "transparent")
border.width: control.checked || control.pressed ? 0 : 1
border.color: control.Theme.frameColor
@@ -101,10 +101,9 @@ AbstractSwitch {
height: parent.height - control.topPadding - control.bottomPadding
text: control.text
- color: control.Theme.textColor
+ color: control.enabled ? control.Theme.textColor : control.Theme.disabledColor
elide: Text.ElideRight
visible: control.text
- opacity: enabled ? 1.0 : control.Theme.disabledOpacity
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}