shell: new lock anim for bkg and bar
This commit is contained in:
parent
c70822c1f5
commit
f6caa3e209
8 changed files with 48 additions and 28 deletions
|
|
@ -8,13 +8,32 @@ import Quickshell.Wayland
|
|||
import Quickshell.Hyprland
|
||||
import Quickshell.Services.Pam
|
||||
import ".."
|
||||
import "../.."
|
||||
import "../background"
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
function init() {}
|
||||
|
||||
property bool locked: false;
|
||||
property bool animState: false;
|
||||
property real lockSlide: animState ? 1.0 : 0.0
|
||||
property real bkgSlide: animState ? 1.0 : 0.0
|
||||
|
||||
Behavior on lockSlide {
|
||||
NumberAnimation {
|
||||
duration: 600
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: [0.0, 0.75, 0.15, 1.0, 1.0, 1.0]
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on bkgSlide {
|
||||
NumberAnimation {
|
||||
duration: 600
|
||||
easing.type: Easing.OutCirc
|
||||
}
|
||||
}
|
||||
|
||||
onLockedChanged: {
|
||||
if (locked) {
|
||||
lockContextLoader.active = true;
|
||||
|
|
@ -101,7 +120,7 @@ Singleton {
|
|||
id: backgroundImage
|
||||
anchors.fill: parent
|
||||
screen: lockSurface.screen
|
||||
visible: !lockAnim.running
|
||||
visible: root.lockSlide == 1.0
|
||||
asynchronous: true
|
||||
}
|
||||
|
||||
|
|
@ -112,23 +131,13 @@ Singleton {
|
|||
visible: false
|
||||
width: lockSurface.width
|
||||
height: lockSurface.height
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
id: lockAnim
|
||||
target: lockContent
|
||||
property: "y"
|
||||
to: 0
|
||||
duration: 600
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: [0.0, 0.75, 0.15, 1.0, 1.0, 1.0]
|
||||
y: -lockSurface.height * (1.0 - root.lockSlide)
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
lockContent.y = -lockSurface.height
|
||||
lockContent.visible = true;
|
||||
lockAnim.running = true;
|
||||
root.animState = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -137,8 +146,7 @@ Singleton {
|
|||
|
||||
function onLockedChanged() {
|
||||
if (!locked) {
|
||||
lockAnim.to = -lockSurface.height
|
||||
lockAnim.running = true;
|
||||
root.animState = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue