Confirm the login form on enter
This commit is contained in:
parent
7959154f46
commit
c88b0a2d55
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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")
|
||||
|
||||
Reference in New Issue
Block a user