mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-01 19:47:25 -04:00
PasswordDialog: fix lack of focus on window change
This commit is contained in:
@@ -38,7 +38,7 @@ import "." as MoneroComponents
|
|||||||
import "effects/" as MoneroEffects
|
import "effects/" as MoneroEffects
|
||||||
import "../js/Utils.js" as Utils
|
import "../js/Utils.js" as Utils
|
||||||
|
|
||||||
Item {
|
FocusScope {
|
||||||
id: root
|
id: root
|
||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
@@ -65,8 +65,6 @@ Item {
|
|||||||
capsLockTextLabel.visible = oshelper.isCapsLock();
|
capsLockTextLabel.visible = oshelper.isCapsLock();
|
||||||
passwordInput1.reset();
|
passwordInput1.reset();
|
||||||
passwordInput2.reset();
|
passwordInput2.reset();
|
||||||
if(!appWindow.currentWallet || appWindow.active)
|
|
||||||
passwordInput1.input.forceActiveFocus();
|
|
||||||
root.walletName = walletName ? walletName : ""
|
root.walletName = walletName ? walletName : ""
|
||||||
errorTextLabel.text = errorText ? errorText : "";
|
errorTextLabel.text = errorText ? errorText : "";
|
||||||
leftPanel.enabled = false
|
leftPanel.enabled = false
|
||||||
@@ -76,6 +74,7 @@ Item {
|
|||||||
root.visible = true;
|
root.visible = true;
|
||||||
appWindow.hideBalanceForced = true;
|
appWindow.hideBalanceForced = true;
|
||||||
appWindow.updateBalance();
|
appWindow.updateBalance();
|
||||||
|
Qt.callLater(() => passwordInput1.input.forceActiveFocus())
|
||||||
}
|
}
|
||||||
|
|
||||||
function open(walletName, errorText, okButtonText, okButtonIcon, backgroundSyncOn) {
|
function open(walletName, errorText, okButtonText, okButtonIcon, backgroundSyncOn) {
|
||||||
@@ -214,6 +213,7 @@ Item {
|
|||||||
MoneroComponents.LineEdit {
|
MoneroComponents.LineEdit {
|
||||||
id: passwordInput1
|
id: passwordInput1
|
||||||
password: true
|
password: true
|
||||||
|
input.focus: root.visible && (appWindow.active || Qt.application.state === Qt.ApplicationActive)
|
||||||
Layout.topMargin: 6
|
Layout.topMargin: 6
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
KeyNavigation.tab: {
|
KeyNavigation.tab: {
|
||||||
|
|||||||
Reference in New Issue
Block a user