Confirm the login form on enter

This commit is contained in:
Michael Zanetti 2022-05-03 00:48:14 +02:00
parent 7959154f46
commit c88b0a2d55
2 changed files with 18 additions and 0 deletions

View File

@ -67,6 +67,8 @@ ColumnLayout {
property bool showErrors: false
signal accepted()
RowLayout {
Layout.fillWidth: true
@ -112,6 +114,14 @@ ColumnLayout {
return ret.join("<br>")
}
onAccepted: {
if (!root.signup) {
root.accepted()
} else {
confirmationPasswordTextField.focus = true
}
}
}
ColorIcon {
Layout.preferredHeight: Style.iconSize
@ -136,6 +146,8 @@ ColumnLayout {
echoMode: root.hiddenPassword ? TextInput.Password : TextInput.Normal
placeholderText: qsTr("Confirm password")
error: root.showErrors && (!root.isValidPassword || !root.confirmationMatches)
onAccepted: root.accepted()
}
}
}

View File

@ -149,6 +149,11 @@ SettingsPageBase {
requireSpecialChar: false
signup: engine.jsonRpcClient.initialSetupRequired
showErrors: loginForm.showErrors
onAccepted: {
if (!signup) {
okButton.clicked()
}
}
}
Label {
@ -177,6 +182,7 @@ SettingsPageBase {
}
Button {
id: okButton
Layout.fillWidth: true
Layout.leftMargin: app.margins; Layout.rightMargin: app.margins; Layout.bottomMargin: app.margins
text: qsTr("OK")