Confirm the login form on enter
This commit is contained in:
parent
7959154f46
commit
c88b0a2d55
@ -67,6 +67,8 @@ ColumnLayout {
|
|||||||
|
|
||||||
property bool showErrors: false
|
property bool showErrors: false
|
||||||
|
|
||||||
|
signal accepted()
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
@ -112,6 +114,14 @@ ColumnLayout {
|
|||||||
return ret.join("<br>")
|
return ret.join("<br>")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
|
if (!root.signup) {
|
||||||
|
root.accepted()
|
||||||
|
} else {
|
||||||
|
confirmationPasswordTextField.focus = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
ColorIcon {
|
ColorIcon {
|
||||||
Layout.preferredHeight: Style.iconSize
|
Layout.preferredHeight: Style.iconSize
|
||||||
@ -136,6 +146,8 @@ ColumnLayout {
|
|||||||
echoMode: root.hiddenPassword ? TextInput.Password : TextInput.Normal
|
echoMode: root.hiddenPassword ? TextInput.Password : TextInput.Normal
|
||||||
placeholderText: qsTr("Confirm password")
|
placeholderText: qsTr("Confirm password")
|
||||||
error: root.showErrors && (!root.isValidPassword || !root.confirmationMatches)
|
error: root.showErrors && (!root.isValidPassword || !root.confirmationMatches)
|
||||||
|
|
||||||
|
onAccepted: root.accepted()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -149,6 +149,11 @@ SettingsPageBase {
|
|||||||
requireSpecialChar: false
|
requireSpecialChar: false
|
||||||
signup: engine.jsonRpcClient.initialSetupRequired
|
signup: engine.jsonRpcClient.initialSetupRequired
|
||||||
showErrors: loginForm.showErrors
|
showErrors: loginForm.showErrors
|
||||||
|
onAccepted: {
|
||||||
|
if (!signup) {
|
||||||
|
okButton.clicked()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@ -177,6 +182,7 @@ SettingsPageBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
id: okButton
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: app.margins; Layout.rightMargin: app.margins; Layout.bottomMargin: app.margins
|
Layout.leftMargin: app.margins; Layout.rightMargin: app.margins; Layout.bottomMargin: app.margins
|
||||||
text: qsTr("OK")
|
text: qsTr("OK")
|
||||||
|
|||||||
Reference in New Issue
Block a user