From f0bd1181235b4e4e92876f56487b17b595841758 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 20 Jul 2016 15:13:06 +0200 Subject: Material: add missing ripple effect to SwipeDelegate Task-number: QTBUG-54764 Change-Id: Ie04c93a823745b6d0a85e0c80c91d4e7f77f6fcd Reviewed-by: Mitch Curtis --- src/imports/controls/material/SwipeDelegate.qml | 18 +++++++++++++++--- src/imports/controls/material/qquickmaterialripple.cpp | 3 +++ 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src/imports/controls/material') diff --git a/src/imports/controls/material/SwipeDelegate.qml b/src/imports/controls/material/SwipeDelegate.qml index 28fc6c2e..4acf4524 100644 --- a/src/imports/controls/material/SwipeDelegate.qml +++ b/src/imports/controls/material/SwipeDelegate.qml @@ -83,9 +83,21 @@ T.SwipeDelegate { Rectangle { width: parent.width height: parent.height - visible: control.down || control.highlighted || control.visualFocus - color: control.visualFocus || control.hovered ? control.Material.swipeDelegateHoverColor : - control.Material.listHighlightColor + visible: control.highlighted + color: control.Material.listHighlightColor + } + + Ripple { + width: parent.width + height: parent.height + + clip: visible + trigger: Ripple.Release + pressed: control.pressed + anchor: control + active: control.down || control.visualFocus || control.hovered + color: control.Material.checkBoxUncheckedRippleColor + enabled: control.swipe.position === 0 } Behavior on x { diff --git a/src/imports/controls/material/qquickmaterialripple.cpp b/src/imports/controls/material/qquickmaterialripple.cpp index 2cb80f1b..f3bc465c 100644 --- a/src/imports/controls/material/qquickmaterialripple.cpp +++ b/src/imports/controls/material/qquickmaterialripple.cpp @@ -275,6 +275,9 @@ void QQuickMaterialRipple::setPressed(bool pressed) m_pressed = pressed; + if (!isEnabled()) + return; + if (pressed) { if (m_trigger == Press) prepareWave(); -- cgit v1.2.3