diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 20:50:39 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 20:50:39 +1000 |
| commit | 2a652d549a56b74cdf5134ffee7d84ef5e96823f (patch) | |
| tree | 27ccdd549bcd865f34eadaddddfe348fd1dbf9bc /modules/lock/LockSurface.qml | |
| parent | systemusage: use sensors for cpu temps (diff) | |
| download | caelestia-shell-2a652d549a56b74cdf5134ffee7d84ef5e96823f.tar.gz caelestia-shell-2a652d549a56b74cdf5134ffee7d84ef5e96823f.tar.bz2 caelestia-shell-2a652d549a56b74cdf5134ffee7d84ef5e96823f.zip | |
feat: lock screen
Diffstat (limited to 'modules/lock/LockSurface.qml')
| -rw-r--r-- | modules/lock/LockSurface.qml | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/modules/lock/LockSurface.qml b/modules/lock/LockSurface.qml new file mode 100644 index 0000000..1b98c2c --- /dev/null +++ b/modules/lock/LockSurface.qml @@ -0,0 +1,97 @@ +import "root:/widgets" +import "root:/services" +import "root:/config" +import Quickshell.Wayland +import QtQuick +import QtQuick.Effects + +WlSessionLockSurface { + id: root + + required property WlSessionLock lock + + property bool locked + + function unlock(): void { + locked = false; + background.opacity = 0; + animDelay.start(); + } + + Component.onCompleted: locked = true + + color: "transparent" + + Timer { + id: animDelay + + interval: Appearance.anim.durations.large + onTriggered: root.lock.locked = false + } + + ScreencopyView { + id: screencopy + + anchors.fill: parent + captureSource: root.screen + visible: false + } + + MultiEffect { + id: background + + anchors.fill: parent + + source: screencopy + autoPaddingEnabled: false + blurEnabled: true + blur: root.locked ? 1 : 0 + blurMax: 64 + blurMultiplier: 1 + + Behavior on opacity { + Anim {} + } + + Behavior on blur { + Anim {} + } + } + + Backgrounds { + id: backgrounds + + locked: root.locked + visible: false + } + + MultiEffect { + anchors.fill: source + source: backgrounds + shadowEnabled: true + blurMax: 15 + shadowColor: Qt.alpha(Colours.palette.m3shadow, 0.7) + } + + Clock { + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.top + anchors.bottomMargin: -backgrounds.clockBottom + + locked: root.locked + } + + Input { + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.bottom + anchors.topMargin: -backgrounds.inputTop + + lock: root + } + + component Anim: NumberAnimation { + duration: Appearance.anim.durations.large + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } +} |