Allow pressing enter to login. #63

This commit is contained in:
Black Hat 2018-10-13 15:58:27 +08:00
parent 8500c5f34b
commit 67cc9a0433
1 changed files with 8 additions and 1 deletions

View File

@ -1,7 +1,14 @@
import QtQuick 2.9
LoginForm {
loginButton.onClicked: {
loginButton.onClicked: doLogin()
Shortcut {
sequence: "Return"
onActivated: doLogin()
}
function doLogin() {
if (!(serverField.text.startsWith("http") && serverField.text.includes("://"))) {
loginButtonTooltip.text = "Server address should start with http(s)://"
loginButtonTooltip.open()