Disable login button until ID & password entered

This commit is contained in:
miruka 2019-08-16 16:44:28 -04:00
parent c7adb5b02f
commit 28b5fbd267
3 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@
- Keyboard flicking against top/bottom edge - Keyboard flicking against top/bottom edge
- Don't strip user spacing in html - Don't strip user spacing in html
- Do something when access token is invalid
- [hr not working](https://bugreports.qt.io/browse/QTBUG-74342) - [hr not working](https://bugreports.qt.io/browse/QTBUG-74342)
- Terrible performance using `QT_QPA_PLATFORM=wayland-egl`, must use `xcb` - Terrible performance using `QT_QPA_PLATFORM=wayland-egl`, must use `xcb`

View File

@ -14,7 +14,7 @@ HScalingBox {
function clickEnterButtonTarget() { function clickEnterButtonTarget() {
for (let i = 0; i < buttonModel.length; i++) { for (let i = 0; i < buttonModel.length; i++) {
let btn = interfaceButtonsRepeater.itemAt(i) let btn = interfaceButtonsRepeater.itemAt(i)
if (btn.name === enterButtonTarget) { btn.clicked() } if (btn.enabled && btn.name === enterButtonTarget) btn.clicked()
} }
} }

View File

@ -4,6 +4,8 @@ import "../Base"
Item { Item {
property string loginWith: "username" property string loginWith: "username"
readonly property bool canLogin: idField.text && passwordField.text
onFocusChanged: idField.forceActiveFocus() onFocusChanged: idField.forceActiveFocus()
HInterfaceBox { HInterfaceBox {
@ -15,7 +17,7 @@ Item {
buttonModel: [ buttonModel: [
{ name: "register", text: qsTr("Register"), enabled: false }, { name: "register", text: qsTr("Register"), enabled: false },
{ name: "login", text: qsTr("Login"), enabled: true }, { name: "login", text: qsTr("Login"), enabled: canLogin },
{ name: "forgot", text: qsTr("Forgot?"), enabled: false } { name: "forgot", text: qsTr("Forgot?"), enabled: false }
] ]