mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:03:53 +02:00
Prevent the login dialog from spawning the address bar on enter keys
This commit is contained in:
parent
fd28baac8c
commit
1beaf18d1b
1 changed files with 18 additions and 10 deletions
|
@ -60,9 +60,6 @@ Dialog {
|
|||
anchors.margins: 8
|
||||
KeyNavigation.tab: password
|
||||
KeyNavigation.backtab: password
|
||||
onAccepted: {
|
||||
password.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,13 +75,6 @@ Dialog {
|
|||
anchors.margins: 8
|
||||
KeyNavigation.tab: username
|
||||
KeyNavigation.backtab: username
|
||||
onAccepted: {
|
||||
if (username.text == "") {
|
||||
username.forceActiveFocus()
|
||||
} else {
|
||||
loginDialog.login(username.text, password.text)
|
||||
}
|
||||
}
|
||||
onFocusChanged: {
|
||||
if (password.focus) {
|
||||
password.selectAll()
|
||||
|
@ -187,4 +177,22 @@ Dialog {
|
|||
}
|
||||
}
|
||||
}
|
||||
Keys.onPressed: {
|
||||
switch(event.key) {
|
||||
case Qt.Key_Enter:
|
||||
case Qt.Key_Return:
|
||||
if (username.activeFocus) {
|
||||
event.accepted = true
|
||||
password.forceActiveFocus()
|
||||
} else if (password.activeFocus) {
|
||||
event.accepted = true
|
||||
if (username.text == "") {
|
||||
username.forceActiveFocus()
|
||||
} else {
|
||||
loginDialog.login(username.text, password.text)
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue