diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2014-04-06 01:01:12 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-07 12:12:47 +0200 |
commit | 9b206d4b0836f0f89aa667b44c6ac0a963808366 (patch) | |
tree | 010e1f9f4ae5e16aafb2bc3192abc88c66461697 | |
parent | a3d87642cdebb32793258b6fe87c590ee5ceb3a5 (diff) | |
download | qtquickcontrols-9b206d4b0836f0f89aa667b44c6ac0a963808366.tar.gz |
ButtonStyle: fix checked state
Restore checked state handling that was lost in fd8d7261.
Task-number: QTBUG-38143
Change-Id: Iec6598d5ddba449da16cfefa55b0d575d2563c47
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
-rw-r--r-- | src/controls/Styles/Base/ButtonStyle.qml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/controls/Styles/Base/ButtonStyle.qml b/src/controls/Styles/Base/ButtonStyle.qml index 1ab680d7..7d4ae4d3 100644 --- a/src/controls/Styles/Base/ButtonStyle.qml +++ b/src/controls/Styles/Base/ButtonStyle.qml @@ -95,19 +95,20 @@ Style { /*! This defines the background of the button. */ property Component background: Item { + property bool down: control.pressed || (control.checkable && control.checked) implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5) implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2)) Rectangle { anchors.fill: parent - anchors.bottomMargin: control.pressed ? 0 : -1 + anchors.bottomMargin: down ? 0 : -1 color: "#10000000" radius: baserect.radius } Rectangle { id: baserect gradient: Gradient { - GradientStop {color: control.pressed ? "#aaa" : "#fefefe" ; position: 0} - GradientStop {color: control.pressed ? "#ccc" : "#e3e3e3" ; position: control.pressed ? 0.1: 1} + GradientStop {color: down ? "#aaa" : "#fefefe" ; position: 0} + GradientStop {color: down ? "#ccc" : "#e3e3e3" ; position: down ? 0.1: 1} } radius: TextSingleton.implicitHeight * 0.16 anchors.fill: parent |