1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-16 10:42:06 -04:00

idle/lock: add option to turn off monitors after lock explicitly

fixes #452
fixes #2156
This commit is contained in:
bbedward
2026-04-14 16:28:52 -04:00
parent 6d0953de68
commit 0ab9b1e4e9
23 changed files with 128 additions and 83 deletions

View File

@@ -23,6 +23,7 @@ Item {
property string passwordBuffer: ""
property bool demoMode: false
property var pam: demoPam
property string screenName: ""
property bool unlocking: false
property string pamState: ""
@@ -58,10 +59,8 @@ Item {
return I18n.tr("Too many attempts - locked out");
if (root.pamState === "fail")
return I18n.tr("Incorrect password - try again");
if (pam.fprintState === "error") {
const detail = (pam.fprint.message || "").trim();
return detail.length > 0 ? I18n.tr("Fingerprint error: %1").arg(detail) : I18n.tr("Fingerprint error");
}
if (pam.fprintState === "error")
return I18n.tr("Fingerprint error");
if (pam.fprintState === "max")
return I18n.tr("Maximum fingerprint attempts reached. Please use password.");
if (pam.fprintState === "fail")
@@ -745,13 +744,6 @@ Item {
easing.type: Theme.standardEasing
}
}
Behavior on color {
ColorAnimation {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
@@ -1639,49 +1631,46 @@ Item {
}
Pam {
id: pam
lockSecured: !demoMode
onUnlockRequested: {
id: demoPam
lockSecured: false
}
Connections {
target: root.pam
function onUnlockRequested() {
root.unlocking = true;
lockerReadyArmed = false;
passwordField.text = "";
root.passwordBuffer = "";
root.unlockRequested();
}
onStateChanged: {
root.pamState = state;
if (state !== "") {
root.unlocking = false;
placeholderDelay.restart();
passwordField.text = "";
root.passwordBuffer = "";
}
}
onU2fPendingChanged: {
if (u2fPending) {
passwordField.text = "";
root.passwordBuffer = "";
if (keyboardController.isKeyboardActive)
keyboardController.hide();
}
}
}
Connections {
target: pam
function onStateChanged() {
root.pamState = root.pam.state;
if (root.pam.state === "")
return;
root.unlocking = false;
placeholderDelay.restart();
passwordField.text = "";
root.passwordBuffer = "";
}
function onU2fPendingChanged() {
if (!root.pam.u2fPending)
return;
passwordField.text = "";
root.passwordBuffer = "";
if (keyboardController.isKeyboardActive)
keyboardController.hide();
}
function onUnlockInProgressChanged() {
if (!pam.unlockInProgress && root.unlocking)
if (!root.pam.unlockInProgress && root.unlocking)
root.unlocking = false;
}
}
Binding {
target: pam
property: "buffer"
value: root.passwordBuffer
}
Timer {
id: placeholderDelay