diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-07-09 16:08:03 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-07-11 07:18:24 +0000 |
commit | 3d4de58050c85e31df79d867a8cba00b1d322cc4 (patch) | |
tree | b0302dc1a6ea6adc59d19a2b81661cfcf8c0c014 /src/imports/controls/material/Switch.qml | |
parent | 7176d160521c4234d081863fa90320aa6527c739 (diff) |
Material: implement ripple effect for SwitchDelegate
Task-number: QTBUG-50003
Change-Id: I33629bd06c125113408a7f5b11dea72821285876
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/material/Switch.qml')
-rw-r--r-- | src/imports/controls/material/Switch.qml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml index 19da6f9c..f4130926 100644 --- a/src/imports/controls/material/Switch.qml +++ b/src/imports/controls/material/Switch.qml @@ -56,6 +56,15 @@ T.Switch { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 control: control + + Ripple { + x: parent.handle.x + parent.handle.width / 2 - width / 2 + y: parent.handle.y + parent.handle.height / 2 - height / 2 + width: 28; height: 28 + pressed: control.pressed + active: control.down || control.visualFocus || control.hovered + color: control.checked ? control.Material.checkBoxCheckedRippleColor : control.Material.checkBoxUncheckedRippleColor + } } contentItem: Text { |