From 3d4de58050c85e31df79d867a8cba00b1d322cc4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 9 Jul 2016 16:08:03 +0200 Subject: Material: implement ripple effect for SwitchDelegate Task-number: QTBUG-50003 Change-Id: I33629bd06c125113408a7f5b11dea72821285876 Reviewed-by: Mitch Curtis --- src/imports/controls/material/SwitchDelegate.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/imports/controls/material/SwitchDelegate.qml') diff --git a/src/imports/controls/material/SwitchDelegate.qml b/src/imports/controls/material/SwitchDelegate.qml index 57a8603c..7b81524c 100644 --- a/src/imports/controls/material/SwitchDelegate.qml +++ b/src/imports/controls/material/SwitchDelegate.qml @@ -76,7 +76,17 @@ T.SwitchDelegate { background: Rectangle { implicitHeight: 48 - visible: control.down || control.highlighted - color: control.down ? control.Material.buttonPressColor : control.Material.listHighlightColor + color: control.down ? control.Material.buttonPressColor : control.highlighted ? control.Material.listHighlightColor : "transparent" + + Ripple { + width: parent.width + height: parent.height + + clip: visible + pressed: control.pressed + anchor: control + active: control.down || control.visualFocus || control.hovered + color: control.Material.checkBoxUncheckedRippleColor + } } } -- cgit v1.2.3