From 57d4ea4e0fe960a0934a20aa8eb3082cfb0dc306 Mon Sep 17 00:00:00 2001 From: rope Date: Wed, 8 Jul 2026 11:20:23 +0100 Subject: [PATCH] lockscreen: fix enter key, add confirm button Co-Authored-By: Claude Fable 5 --- settings/quickshell.nix | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/settings/quickshell.nix b/settings/quickshell.nix index 45b08e2..45599eb 100644 --- a/settings/quickshell.nix +++ b/settings/quickshell.nix @@ -321,12 +321,43 @@ in enabled: !pam.active echoMode: TextInput.Password focus: true - onAccepted: { + function go() { lock.submit(text); text = ""; } + // Explicit key handlers: accepted() doesn't + // fire reliably on the lock surface. + Keys.onReturnPressed: go() + Keys.onEnterPressed: go() + onAccepted: go() Keys.onEscapePressed: text = "" } + + // Visible confirm button (after TextInput: on top) + Rectangle { + anchors.right: parent.right + anchors.rightMargin: 6 + anchors.verticalCenter: parent.verticalCenter + width: 32; height: 32; radius: 16 + color: confirmMa.containsMouse ? Theme.base02 : "transparent" + Behavior on color { ColorAnimation { duration: Theme.animFade } } + visible: pwInput.text.length > 0 + + Text { + anchors.centerIn: parent + text: "arrow_forward" + font.family: Theme.iconFont + font.pixelSize: 18 + color: Theme.base0D + } + MouseArea { + id: confirmMa + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: pwInput.go() + } + } } }