diff --git a/.config/quickshell/ii/GlobalStates.qml b/.config/quickshell/ii/GlobalStates.qml index 163507177..3f7468f4c 100644 --- a/.config/quickshell/ii/GlobalStates.qml +++ b/.config/quickshell/ii/GlobalStates.qml @@ -19,6 +19,7 @@ Singleton { property bool overviewOpen: false property bool screenLocked: false property bool screenLockContainsCharacters: false + property bool screenUnlockFailed: false property bool sessionOpen: false property bool superDown: false property bool superReleaseMightTrigger: true diff --git a/.config/quickshell/ii/modules/background/Background.qml b/.config/quickshell/ii/modules/background/Background.qml index 2eb5c3ec7..b06b6294f 100644 --- a/.config/quickshell/ii/modules/background/Background.qml +++ b/.config/quickshell/ii/modules/background/Background.qml @@ -283,8 +283,8 @@ Variants { Behavior on opacity { animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) } - text: "Enter password" - color: CF.ColorUtils.transparentize(bgRoot.colText, 0.3) + text: GlobalStates.screenUnlockFailed ? Translation.tr("Incorrect password") : Translation.tr("Enter password") + color: GlobalStates.screenUnlockFailed ? Appearance.colors.colError : bgRoot.colText font { pixelSize: Appearance.font.pixelSize.normal } diff --git a/.config/quickshell/ii/modules/lock/LockContext.qml b/.config/quickshell/ii/modules/lock/LockContext.qml index ede61eed8..18728136d 100644 --- a/.config/quickshell/ii/modules/lock/LockContext.qml +++ b/.config/quickshell/ii/modules/lock/LockContext.qml @@ -24,7 +24,10 @@ Scope { } onCurrentTextChanged: { - showFailure = false; // Clear the failure text once the user starts typing. + if (currentText.length > 0) { + showFailure = false; + GlobalStates.screenUnlockFailed = false; + } GlobalStates.screenLockContainsCharacters = currentText.length > 0; passwordClearTimer.restart(); } @@ -58,6 +61,7 @@ Scope { root.unlocked(); } else { root.showFailure = true; + GlobalStates.screenUnlockFailed = true; } root.currentText = ""; diff --git a/.config/quickshell/ii/modules/lock/LockSurface.qml b/.config/quickshell/ii/modules/lock/LockSurface.qml index 98d1f57b5..a0b28445d 100644 --- a/.config/quickshell/ii/modules/lock/LockSurface.qml +++ b/.config/quickshell/ii/modules/lock/LockSurface.qml @@ -75,17 +75,10 @@ MouseArea { animation: Appearance.animation.elementMove.numberAnimation.createObject(this) } radius: Appearance.rounding.full - color: Appearance.colors.colLayer2 + color: Appearance.m3colors.m3surfaceContainer implicitWidth: 160 implicitHeight: 44 - StyledText { - visible: root.context.showFailure && passwordBox.text.length == 0 - anchors.centerIn: parent - text: "Incorrect" - color: Appearance.m3colors.m3error - } - StyledTextInput { id: passwordBox