lock: lazy load locker
This commit is contained in:
parent
2a652d549a
commit
3a66c4941e
1 changed files with 17 additions and 6 deletions
|
|
@ -6,18 +6,29 @@ import Quickshell.Io
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
WlSessionLock {
|
LazyLoader {
|
||||||
id: lock
|
id: loader
|
||||||
|
|
||||||
LockSurface {
|
WlSessionLock {
|
||||||
lock: lock
|
id: lock
|
||||||
|
|
||||||
|
locked: true
|
||||||
|
|
||||||
|
onLockedChanged: {
|
||||||
|
if (!locked)
|
||||||
|
loader.active = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LockSurface {
|
||||||
|
lock: lock
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomShortcut {
|
CustomShortcut {
|
||||||
name: "lock"
|
name: "lock"
|
||||||
description: "Lock the current session"
|
description: "Lock the current session"
|
||||||
onPressed: lock.locked = true
|
onPressed: loader.activeAsync = true
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomShortcut {
|
CustomShortcut {
|
||||||
|
|
@ -30,7 +41,7 @@ Scope {
|
||||||
target: "lock"
|
target: "lock"
|
||||||
|
|
||||||
function lock(): void {
|
function lock(): void {
|
||||||
lock.locked = true;
|
loader.activeAsync = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue