lockscreen: fix enter key, add confirm button

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-07-08 11:20:23 +01:00
parent bedb11930f
commit 57d4ea4e0f

View file

@ -321,12 +321,43 @@ in
enabled: !pam.active enabled: !pam.active
echoMode: TextInput.Password echoMode: TextInput.Password
focus: true focus: true
onAccepted: { function go() {
lock.submit(text); lock.submit(text);
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 = "" 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()
}
}
} }
} }