lock screen: add lock.threatEffect toggle for fail visuals
This commit is contained in:
parent
c1588ceb5e
commit
be7142ba59
3 changed files with 10 additions and 3 deletions
|
|
@ -126,6 +126,11 @@ in
|
||||||
default = true;
|
default = true;
|
||||||
description = "Show weather summary on the lock screen.";
|
description = "Show weather summary on the lock screen.";
|
||||||
};
|
};
|
||||||
|
threatEffect = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Show red vignette and chromatic aberration on failed password attempts.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
notifications = moduleOpt "notifications" {
|
notifications = moduleOpt "notifications" {
|
||||||
timeout = lib.mkOption {
|
timeout = lib.mkOption {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ WlSessionLockSurface {
|
||||||
property real _unlockFade: 1
|
property real _unlockFade: 1
|
||||||
|
|
||||||
// Threat level: 0.0-1.0 based on fail count (5 fails = max)
|
// Threat level: 0.0-1.0 based on fail count (5 fails = max)
|
||||||
readonly property real _threat: Math.min(1.0, root.auth.failCount / 5)
|
readonly property bool _threatEnabled: S.Modules.lock.threatEffect ?? true
|
||||||
|
readonly property real _threat: _threatEnabled ? Math.min(1.0, root.auth.failCount / 5) : 0
|
||||||
property real _heartbeat: 0
|
property real _heartbeat: 0
|
||||||
|
|
||||||
// All visual content wrapped for threat shader
|
// All visual content wrapped for threat shader
|
||||||
|
|
@ -321,7 +322,7 @@ WlSessionLockSurface {
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
id: _heartbeatAnim
|
id: _heartbeatAnim
|
||||||
loops: Animation.Infinite
|
loops: Animation.Infinite
|
||||||
running: root.auth.failCount >= 3 && root.lock.secure
|
running: root._threatEnabled && root.auth.failCount >= 3 && root.lock.secure
|
||||||
|
|
||||||
// Systole (sharp spike)
|
// Systole (sharp spike)
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,8 @@ QtObject {
|
||||||
notifications: true,
|
notifications: true,
|
||||||
mpris: true,
|
mpris: true,
|
||||||
volume: true,
|
volume: true,
|
||||||
weather: true
|
weather: true,
|
||||||
|
threatEffect: true
|
||||||
})
|
})
|
||||||
property var statsDaemon: ({
|
property var statsDaemon: ({
|
||||||
interval: -1
|
interval: -1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue