From b2b733f272c1970e0a92c925c96b7c616fa6e354 Mon Sep 17 00:00:00 2001 From: Anatasof Wirapraja Date: Thu, 19 Sep 2019 17:16:39 +0700 Subject: `continueButton` enabled on `emilTextField` text change --- features/LoginEmail.qml | 10 +++++++++- features/LoginEmailForm.ui.qml | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'features') 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 } } } -- cgit v1.2.3