mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
Fix keyboard focus during setup while tip is up
This commit is contained in:
parent
751dca0761
commit
3742ccbdd3
2 changed files with 13 additions and 4 deletions
|
@ -26,6 +26,7 @@ Item {
|
|||
id: root;
|
||||
property bool isChangingPassphrase: false;
|
||||
property bool isShowingTip: false;
|
||||
property bool shouldImmediatelyFocus: true;
|
||||
|
||||
// This object is always used in a popup.
|
||||
// This MouseArea is used to prevent a user from being
|
||||
|
@ -53,10 +54,8 @@ Item {
|
|||
// TODO: Fix this unlikely bug
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
if (root.isChangingPassphrase) {
|
||||
currentPassphraseField.focus = true;
|
||||
} else {
|
||||
passphraseField.focus = true;
|
||||
if (root.shouldImmediatelyFocus) {
|
||||
focusFirstTextField();
|
||||
}
|
||||
sendMessageToLightbox({method: 'disableHmdPreview'});
|
||||
} else {
|
||||
|
@ -320,5 +319,13 @@ Item {
|
|||
setErrorText("");
|
||||
}
|
||||
|
||||
function focusFirstTextField() {
|
||||
if (root.isChangingPassphrase) {
|
||||
currentPassphraseField.focus = true;
|
||||
} else {
|
||||
passphraseField.focus = true;
|
||||
}
|
||||
}
|
||||
|
||||
signal sendMessageToLightbox(var msg);
|
||||
}
|
||||
|
|
|
@ -422,6 +422,7 @@ Item {
|
|||
onClicked: {
|
||||
root.hasShownSecurityImageTip = true;
|
||||
securityImageTip.visible = false;
|
||||
passphraseSelection.focusFirstTextField();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -466,6 +467,7 @@ Item {
|
|||
|
||||
PassphraseSelection {
|
||||
id: passphraseSelection;
|
||||
shouldImmediatelyFocus: root.hasShownSecurityImageTip;
|
||||
isShowingTip: securityImageTip.visible;
|
||||
anchors.top: passphraseTitleHelper.bottom;
|
||||
anchors.topMargin: 30;
|
||||
|
|
Loading…
Reference in a new issue