diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-05-30 14:20:35 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-05-31 09:15:13 +0000 |
commit | 260015a26b8d368fef3559a0e47a8a3928ce9044 (patch) | |
tree | 89015cca9e1621133d25032eb0a5dee823814d0e /src | |
parent | a37f7f845c93ab7cb6b1a2b200a198c401a6a625 (diff) |
Material: fix disabled and tristate CheckBox
Somehow these changes went missing when CheckIndicator was introduced
in bb06d89. It was probably a copy-paste from an outdated CheckBox.qml.
Change-Id: I9e5f3801f627de71f80620b5615771f7730b906c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/controls/material/CheckIndicator.qml | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/imports/controls/material/CheckIndicator.qml b/src/imports/controls/material/CheckIndicator.qml index c541e221..f64ca168 100644 --- a/src/imports/controls/material/CheckIndicator.qml +++ b/src/imports/controls/material/CheckIndicator.qml @@ -42,7 +42,7 @@ Rectangle { implicitWidth: 18 implicitHeight: 18 color: "transparent" - border.color: control.checked ? control.Material.accentColor : control.Material.secondaryTextColor + border.color: control.checked && control.enabled ? control.Material.accentColor : control.Material.secondaryTextColor border.width: control.checked ? width / 2 : 2 radius: 2 @@ -81,15 +81,31 @@ Rectangle { source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/check.png" fillMode: Image.PreserveAspectFit - scale: control.checked ? 1 : 0 + scale: control.checkState === Qt.Checked ? 1 : 0 Behavior on scale { NumberAnimation { duration: 100 } } } - states: State { - name: "checked" - when: control.checked + Rectangle { + x: (parent.width - width) / 2 + y: (parent.height - height) / 2 + width: 12 + height: 3 + + scale: control.checkState === Qt.PartiallyChecked ? 1 : 0 + Behavior on scale { NumberAnimation { duration: 100 } } } + states: [ + State { + name: "checked" + when: control.checkState === Qt.Checked + }, + State { + name: "partiallychecked" + when: control.checkState === Qt.PartiallyChecked + } + ] + transitions: Transition { SequentialAnimation { NumberAnimation { |