From 67cc9a043358560b2174e603ad3daa2fe9a9bdc7 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Sat, 13 Oct 2018 15:58:27 +0800 Subject: [PATCH] Allow pressing enter to login. #63 --- imports/Spectral/Page/Login.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/imports/Spectral/Page/Login.qml b/imports/Spectral/Page/Login.qml index dc72465..b949e86 100644 --- a/imports/Spectral/Page/Login.qml +++ b/imports/Spectral/Page/Login.qml @@ -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()