mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 16:17:03 +00:00
GODT-1823: fixed enter key not responding in sign in's 2FA and 2-password fields.
Other: fixed initial keyboard focus on all sign in screen calls.
This commit is contained in:
@ -368,7 +368,7 @@ Item {
|
|||||||
rightContent.currentIndex = 0
|
rightContent.currentIndex = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function showSignIn () { rightContent.currentIndex = 1 }
|
function showSignIn () { rightContent.currentIndex = 1; signIn.focus = true }
|
||||||
function showGeneralSettings () { rightContent.currentIndex = 2 }
|
function showGeneralSettings () { rightContent.currentIndex = 2 }
|
||||||
function showKeychainSettings () { rightContent.currentIndex = 3 }
|
function showKeychainSettings () { rightContent.currentIndex = 3 }
|
||||||
function showPortSettings () { rightContent.currentIndex = 4 }
|
function showPortSettings () { rightContent.currentIndex = 4 }
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import QtQuick.Controls.impl
|
|||||||
|
|
||||||
import Proton
|
import Proton
|
||||||
|
|
||||||
Item {
|
FocusScope {
|
||||||
id: root
|
id: root
|
||||||
property ColorScheme colorScheme
|
property ColorScheme colorScheme
|
||||||
|
|
||||||
@ -89,6 +89,7 @@ Item {
|
|||||||
console.assert(stackLayout.currentIndex == 0, "Unexpected login2FARequested")
|
console.assert(stackLayout.currentIndex == 0, "Unexpected login2FARequested")
|
||||||
twoFactorUsernameLabel.text = username
|
twoFactorUsernameLabel.text = username
|
||||||
stackLayout.currentIndex = 1
|
stackLayout.currentIndex = 1
|
||||||
|
twoFactorPasswordTextField.focus = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLogin2FAError(errorMsg) {
|
function onLogin2FAError(errorMsg) {
|
||||||
@ -99,6 +100,7 @@ Item {
|
|||||||
twoFactorPasswordTextField.enabled = true
|
twoFactorPasswordTextField.enabled = true
|
||||||
twoFactorPasswordTextField.error = true
|
twoFactorPasswordTextField.error = true
|
||||||
twoFactorPasswordTextField.errorString = qsTr("Your code is incorrect")
|
twoFactorPasswordTextField.errorString = qsTr("Your code is incorrect")
|
||||||
|
twoFactorPasswordTextField.focus = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLogin2FAErrorAbort(errorMsg) {
|
function onLogin2FAErrorAbort(errorMsg) {
|
||||||
@ -110,6 +112,7 @@ Item {
|
|||||||
function onLogin2PasswordRequested() {
|
function onLogin2PasswordRequested() {
|
||||||
console.assert(stackLayout.currentIndex == 0 || stackLayout.currentIndex == 1, "Unexpected login2PasswordRequested")
|
console.assert(stackLayout.currentIndex == 0 || stackLayout.currentIndex == 1, "Unexpected login2PasswordRequested")
|
||||||
stackLayout.currentIndex = 2
|
stackLayout.currentIndex = 2
|
||||||
|
secondPasswordTextField.focus = true
|
||||||
}
|
}
|
||||||
function onLogin2PasswordError(errorMsg) {
|
function onLogin2PasswordError(errorMsg) {
|
||||||
console.assert(stackLayout.currentIndex == 2, "Unexpected login2PasswordError")
|
console.assert(stackLayout.currentIndex == 2, "Unexpected login2PasswordError")
|
||||||
@ -119,6 +122,7 @@ Item {
|
|||||||
secondPasswordTextField.enabled = true
|
secondPasswordTextField.enabled = true
|
||||||
secondPasswordTextField.error = true
|
secondPasswordTextField.error = true
|
||||||
secondPasswordTextField.errorString = qsTr("Your mailbox password is incorrect")
|
secondPasswordTextField.errorString = qsTr("Your mailbox password is incorrect")
|
||||||
|
secondPasswordTextField.focus = true
|
||||||
}
|
}
|
||||||
function onLogin2PasswordErrorAbort(errorMsg) {
|
function onLogin2PasswordErrorAbort(errorMsg) {
|
||||||
console.assert(stackLayout.currentIndex == 2, "Unexpected login2PasswordErrorAbort")
|
console.assert(stackLayout.currentIndex == 2, "Unexpected login2PasswordErrorAbort")
|
||||||
@ -143,6 +147,7 @@ Item {
|
|||||||
usernameTextField.enabled = true
|
usernameTextField.enabled = true
|
||||||
usernameTextField.error = false
|
usernameTextField.error = false
|
||||||
usernameTextField.errorString = ""
|
usernameTextField.errorString = ""
|
||||||
|
usernameTextField.focus = true
|
||||||
|
|
||||||
passwordTextField.enabled = true
|
passwordTextField.enabled = true
|
||||||
passwordTextField.error = false
|
passwordTextField.error = false
|
||||||
@ -198,7 +203,7 @@ Item {
|
|||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
id: usernameTextField
|
id: usernameTextField
|
||||||
label: qsTr("Username or email")
|
label: qsTr("Username or email")
|
||||||
|
focus: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 24
|
Layout.topMargin: 24
|
||||||
|
|
||||||
@ -335,10 +340,15 @@ Item {
|
|||||||
|
|
||||||
validator: function(str) {
|
validator: function(str) {
|
||||||
if (str.length === 0) {
|
if (str.length === 0) {
|
||||||
return qsTr("Enter username or email")
|
return qsTr("Enter the 6-digit code")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
|
twoFAButton.onClicked()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -399,10 +409,14 @@ Item {
|
|||||||
|
|
||||||
validator: function(str) {
|
validator: function(str) {
|
||||||
if (str.length === 0) {
|
if (str.length === 0) {
|
||||||
return qsTr("Enter username or email")
|
return qsTr("Enter password")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
|
secondPasswordButton.onClicked()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|||||||
@ -222,6 +222,7 @@ Item {
|
|||||||
Layout.preferredWidth: 320
|
Layout.preferredWidth: 320
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
focus: true
|
||||||
username: Backend.users.count === 1 && Backend.users.get(0) && Backend.users.get(0).loggedIn === false ? Backend.users.get(0).username : ""
|
username: Backend.users.count === 1 && Backend.users.get(0) && Backend.users.get(0).loggedIn === false ? Backend.users.get(0).username : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user