lockscreen: fix enter key, add confirm button
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
bedb11930f
commit
57d4ea4e0f
1 changed files with 32 additions and 1 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue