mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-27 06:52:50 -05:00
lockscreen: implement
This commit is contained in:
@@ -13,23 +13,6 @@ MouseArea {
|
||||
cursorShape: disabled ? undefined : Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
|
||||
onPressed: event => {
|
||||
if (disabled) return;
|
||||
|
||||
rippleAnimation.x = event.x;
|
||||
rippleAnimation.y = event.y;
|
||||
|
||||
const dist = (ox, oy) => ox * ox + oy * oy;
|
||||
rippleAnimation.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)
|
||||
));
|
||||
|
||||
rippleAnimation.restart();
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: hoverLayer
|
||||
anchors.fill: parent
|
||||
@@ -39,60 +22,5 @@ MouseArea {
|
||||
root.pressed ? 0.12 :
|
||||
root.containsMouse ? 0.08 : 0)
|
||||
|
||||
Rectangle {
|
||||
id: ripple
|
||||
radius: width / 2
|
||||
color: root.stateColor
|
||||
opacity: 0
|
||||
|
||||
transform: Translate {
|
||||
x: -ripple.width / 2
|
||||
y: -ripple.height / 2
|
||||
}
|
||||
}
|
||||
|
||||
// Clip ripple to container bounds
|
||||
clip: true
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
id: rippleAnimation
|
||||
|
||||
property real x
|
||||
property real y
|
||||
property real radius
|
||||
|
||||
PropertyAction {
|
||||
target: ripple
|
||||
property: "x"
|
||||
value: rippleAnimation.x
|
||||
}
|
||||
PropertyAction {
|
||||
target: ripple
|
||||
property: "y"
|
||||
value: rippleAnimation.y
|
||||
}
|
||||
PropertyAction {
|
||||
target: ripple
|
||||
property: "opacity"
|
||||
value: 0.12
|
||||
}
|
||||
NumberAnimation {
|
||||
target: ripple
|
||||
properties: "width,height"
|
||||
from: 0
|
||||
to: rippleAnimation.radius * 2
|
||||
duration: Appearance.anim.durations.normal
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
||||
}
|
||||
NumberAnimation {
|
||||
target: ripple
|
||||
property: "opacity"
|
||||
to: 0
|
||||
duration: Appearance.anim.durations.normal
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: Appearance.anim.curves.standard
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user