diff options
Diffstat (limited to 'widgets/StateLayer.qml')
| -rw-r--r-- | widgets/StateLayer.qml | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/widgets/StateLayer.qml b/widgets/StateLayer.qml index 953ee61..06cdc21 100644 --- a/widgets/StateLayer.qml +++ b/widgets/StateLayer.qml @@ -19,11 +19,14 @@ MouseArea { hoverEnabled: true onPressed: event => { + if (disabled) + return; + rippleAnim.x = event.x; rippleAnim.y = event.y; const dist = (ox, oy) => ox * ox + oy * oy; - rippleAnim.radius = Math.sqrt(Math.max(dist(0, 0), dist(0, width), dist(width, 0), dist(width, height))); + rippleAnim.radius = Math.sqrt(Math.max(dist(event.x, event.y), dist(event.x, height - event.y), dist(width - event.x, event.y), dist(width - event.x, height - event.y))); rippleAnim.restart(); } @@ -50,25 +53,23 @@ MouseArea { PropertyAction { target: ripple property: "opacity" - value: 0.1 + value: 0.08 } - ParallelAnimation { - Anim { - target: ripple - properties: "implicitWidth,implicitHeight" - from: 0 - to: rippleAnim.radius * 2 - duration: Appearance.anim.durations.large - easing.bezierCurve: Appearance.anim.curves.standardDecel - } - Anim { - target: ripple - property: "opacity" - to: 0 - duration: Appearance.anim.durations.large - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } + Anim { + target: ripple + properties: "implicitWidth,implicitHeight" + from: 0 + to: rippleAnim.radius * 2 + duration: Appearance.anim.durations.normal + easing.bezierCurve: Appearance.anim.curves.standardDecel + } + Anim { + target: ripple + property: "opacity" + to: 0 + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard } } |