diff options
-rw-r--r-- | Login.qml | 10 | ||||
-rw-r--r-- | LoginForm.ui.qml | 113 | ||||
-rw-r--r-- | kelakon.qrc | 2 | ||||
-rw-r--r-- | main.qml | 17 | ||||
-rw-r--r-- | pages/Email.qml | 18 | ||||
-rw-r--r-- | pages/EmailForm.ui.qml | 81 |
6 files changed, 171 insertions, 70 deletions
@@ -1,6 +1,12 @@ import QtQuick 2.12 LoginForm { - width: appWindow.width - height: appWindow.height + width: appWindow.width + height: appWindow.height + + emailButton { + onClicked: { + stackView.push("qrc:/pages/Email.qml") + } + } } diff --git a/LoginForm.ui.qml b/LoginForm.ui.qml index a85f081..4206c1a 100644 --- a/LoginForm.ui.qml +++ b/LoginForm.ui.qml @@ -11,69 +11,64 @@ Rectangle { property alias emailButton: emailButton RowLayout { - x: 34 - y: 419 - width: googleButton.width - height: googleButton.height - anchors.horizontalCenterOffset: 0 anchors.horizontalCenter: parent.horizontalCenter - } - - Button { - id: googleButton - text: qsTr("Continue with Button") - y: 419 - height: 36 - - anchors.right: parent.right - anchors.rightMargin: 16 anchors.left: parent.left + anchors.right: parent.right anchors.leftMargin: 16 + anchors.rightMargin: 16 + anchors.bottom: disclaimer.top anchors.bottomMargin: 16 - anchors.bottom: emailButton.top - contentItem: Text { - text: googleButton.text - color: "#FFF" - font.pointSize: 14 - font.family: "Google Sans" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - background: Rectangle { - color: "#6d22e9" - radius: 6 + Button { + id: emailButton + text: qsTr("Continue with E-Mail") + height: 36 + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + + contentItem: Text { + text: emailButton.text + color: "#6d22e9" + font.pointSize: 14 + font.family: "Google Sans" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + background: Rectangle { + color: "#fff" + border.color: "#6d22e9" + border.width: 1 + radius: 6 + } } - } - Button { - id: emailButton - text: qsTr("Continue with E-Mail") - x: 41 - y: 516 - height: 36 - anchors.left: parent.left - anchors.leftMargin: 16 - anchors.bottom: disclaimer.top - anchors.bottomMargin: 16 - anchors.right: parent.right - anchors.rightMargin: 16 + Button { + id: googleButton + text: qsTr("Continue with Button") + y: 419 + height: 36 - contentItem: Text { - text: emailButton.text - color: "#6d22e9" - font.pointSize: 14 - font.family: "Google Sans" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - background: Rectangle { - color: "#fff" - border.color: "#6d22e9" - border.width: 1 - radius: 6 + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: emailButton.top + anchors.bottomMargin: 16 + + contentItem: Text { + text: googleButton.text + color: "#FFF" + font.pointSize: 14 + font.family: "Google Sans" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + background: Rectangle { + opacity: enabled ? 1.0 : 0.3 + color: googleButton.down ? "#6d22e9" : "#4F12DA" + radius: 6 + } } } @@ -108,11 +103,3 @@ Rectangle { source: "kelakon-logo.png" } } - - - - -/*##^## Designer { - D{i:9;anchors_width:100;anchors_x:139;anchors_y:93} -} - ##^##*/ diff --git a/kelakon.qrc b/kelakon.qrc index cbd3e07..0ca9dd7 100644 --- a/kelakon.qrc +++ b/kelakon.qrc @@ -4,5 +4,7 @@ <file>Login.qml</file> <file>LoginForm.ui.qml</file> <file>kelakon-logo.png</file> + <file>pages/Email.qml</file> + <file>pages/EmailForm.ui.qml</file> </qresource> </RCC> @@ -2,10 +2,17 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 ApplicationWindow { - id: appWindow - width: 362 - height: 628 - visible: true + id: appWindow + width: 362 + height: 628 + visible: true + + StackView { + id: stackView + width: 362 + height: 628 + + initialItem: Login {} + } - Login {} } diff --git a/pages/Email.qml b/pages/Email.qml new file mode 100644 index 0000000..05ecb45 --- /dev/null +++ b/pages/Email.qml @@ -0,0 +1,18 @@ +import QtQuick 2.12 + +EmailForm { + width: stackView.width + height: stackView.height + + loginButton { + onClicked: { + appWindow.logIn("62" + phoneTextField.text, passwordTextField.text) + } + } + + laterButton { + onClicked: { + stackView.pop() + } + } +} diff --git a/pages/EmailForm.ui.qml b/pages/EmailForm.ui.qml new file mode 100644 index 0000000..498aa6a --- /dev/null +++ b/pages/EmailForm.ui.qml @@ -0,0 +1,81 @@ +import QtQuick 2.12 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.12 + +Rectangle { + width: 363 + height: 628 + color: "#f44236" + border.width: 0 + + property alias phoneTextField: phoneTextField + property alias passwordTextField: passwordTextField + property alias loginButton: loginButton + property alias laterButton: laterButton + + Label { + x: 124 + y: 177 + width: 116 + height: 17 + text: qsTr("E-mail") + anchors.horizontalCenter: parent.horizontalCenter + } + + RowLayout { + x: 34 + y: 411 + width: loginButton.width + height: loginButton.height + anchors.bottom: passwordTextField.top + anchors.horizontalCenter: parent.horizontalCenter + + Label { + id: prefixLabel + text: "+62" + } + + TextField { + id: phoneTextField + width: 303 + Layout.fillWidth: true + placeholderText: "812345678" + } + } + + TextField { + id: passwordTextField + x: 34 + y: 468 + width: loginButton.width + height: loginButton.height + anchors.bottom: loginButton.top + anchors.horizontalCenter: parent.horizontalCenter + echoMode: TextInput.Password + placeholderText: qsTr("Kata Sandi") + } + + Button { + id: loginButton + x: 34 + y: 525 + width: 296 + height: 57 + text: qsTr("Masuk") + anchors.bottomMargin: -2 + anchors.bottom: laterButton.top + anchors.horizontalCenterOffset: 0 + anchors.horizontalCenter: parent.horizontalCenter + } + + Button { + id: laterButton + x: 41 + y: 580 + text: qsTr("NANTI SAJA") + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 41 + } +} |