diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-07-20 15:23:20 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-07-20 14:39:32 +0000 |
commit | fadea3366d01f09d8e7d619c9ff6a21d71d7b140 (patch) | |
tree | 5d1380e1124ba09f083778e041eb90ae04e68ee2 | |
parent | f0bd1181235b4e4e92876f56487b17b595841758 (diff) |
Material: add missing ripple effect to SpinBox buttons
Task-number: QTBUG-54764
Change-Id: Ie038161264c989853b2b6ec0bfceb09a1cd1195c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/imports/controls/material/SpinBox.qml | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml index 35bf73b8..da24d85e 100644 --- a/src/imports/controls/material/SpinBox.qml +++ b/src/imports/controls/material/SpinBox.qml @@ -104,17 +104,23 @@ T.SpinBox { inputMethodHints: Qt.ImhFormattedNumbersOnly } - up.indicator: PaddedRectangle { + up.indicator: Item { x: control.mirrored ? 0 : parent.width - width implicitWidth: 48 implicitHeight: 48 height: parent.height width: height - padding: control.spacing - radius: 2 - color: Qt.tint(Qt.tint(control.Material.buttonColor, - control.activeFocus ? control.Material.buttonHoverColor : "transparent"), - control.up.pressed ? control.Material.buttonPressColor: "transparent") + + Ripple { + clipRadius: 2 + x: control.spacing + y: control.spacing + width: parent.width - 2 * control.spacing + height: parent.height - 2 * control.spacing + pressed: control.up.pressed + active: control.up.pressed || control.up.hovered || control.visualFocus + color: control.Material.checkBoxUncheckedRippleColor + } Rectangle { x: (parent.width - width) / 2 @@ -132,17 +138,23 @@ T.SpinBox { } } - down.indicator: PaddedRectangle { + down.indicator: Item { x: control.mirrored ? parent.width - width : 0 implicitWidth: 48 implicitHeight: 48 height: parent.height width: height - padding: control.spacing - radius: 2 - color: Qt.tint(Qt.tint(control.Material.buttonColor, - control.activeFocus ? control.Material.buttonHoverColor : "transparent"), - control.down.pressed ? control.Material.buttonPressColor : "transparent") + + Ripple { + clipRadius: 2 + x: control.spacing + y: control.spacing + width: parent.width - 2 * control.spacing + height: parent.height - 2 * control.spacing + pressed: control.down.pressed + active: control.down.pressed || control.down.hovered || control.visualFocus + color: control.Material.checkBoxUncheckedRippleColor + } Rectangle { x: (parent.width - width) / 2 |