diff options
author | Anatasof Wirapraja <anatasof.wirapraja@gmail.com> | 2019-09-19 17:16:39 +0700 |
---|---|---|
committer | Anatasof Wirapraja <anatasof.wirapraja@gmail.com> | 2019-09-19 17:16:39 +0700 |
commit | b2b733f272c1970e0a92c925c96b7c616fa6e354 (patch) | |
tree | ab89d8618de0df5cad5ebeec7f4802c6aae099dc /features | |
parent | 7625e24271ebb98848f92eb69d5706221a2efac3 (diff) |
`continueButton` enabled on `emilTextField` text change
Diffstat (limited to 'features')
-rw-r--r-- | features/LoginEmail.qml | 10 | ||||
-rw-r--r-- | features/LoginEmailForm.ui.qml | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/features/LoginEmail.qml b/features/LoginEmail.qml index 3352f4a..4d783ba 100644 --- a/features/LoginEmail.qml +++ b/features/LoginEmail.qml @@ -3,7 +3,15 @@ import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.12 -LoginEmailForm {} +LoginEmailForm { + anchors.fill: parent + emailTextField.onTextChanged: { + if (!emailTextField.text || !continueButton.enabled) + continueButton.enabled = !continueButton.enabled + } +} + + /*##^## Designer { diff --git a/features/LoginEmailForm.ui.qml b/features/LoginEmailForm.ui.qml index 501b575..b3cf24c 100644 --- a/features/LoginEmailForm.ui.qml +++ b/features/LoginEmailForm.ui.qml @@ -8,6 +8,7 @@ Page { title: qsTr("Log in") property alias continueButton: continueButton + property alias emailTextField: emailTextField Text { id: pageTitle @@ -66,7 +67,7 @@ Page { } TextField { - id: emailForm + id: emailTextField topPadding: 16 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Layout.rightMargin: 16 @@ -125,6 +126,7 @@ Page { icon.name: "arrow-forward-icon" icon.source: "../components/icons/arrow-forward-24px.svg" highlighted: true + enabled: false } } } |