diff options
-rw-r--r-- | ConfirmPassword.qml (renamed from pages/ConfirmPassword.qml) | 12 | ||||
-rw-r--r-- | CreateProfile.qml | 20 | ||||
-rw-r--r-- | Email.qml (renamed from pages/Email.qml) | 12 | ||||
-rw-r--r-- | Home.qml (renamed from pages/Home.qml) | 3 | ||||
-rw-r--r-- | Login.qml | 40 | ||||
-rw-r--r-- | LoginEmail.qml | 18 | ||||
-rw-r--r-- | LoginPassword.qml | 20 | ||||
-rw-r--r-- | Onboarding.qml | 16 | ||||
-rw-r--r-- | Password.qml (renamed from pages/Password.qml) | 12 | ||||
-rw-r--r-- | Profile.qml | 19 | ||||
-rw-r--r-- | assets/arrow-forward-24px.svg (renamed from assets/arrow-back-24px.svg) | 2 | ||||
-rw-r--r-- | assets/email-24px.svg | 1 | ||||
-rw-r--r-- | assets/lock-24px.svg | 1 | ||||
-rw-r--r-- | controller.cxx | 10 | ||||
-rw-r--r-- | kelakon.qrc | 90 | ||||
-rw-r--r-- | main.qml | 31 | ||||
-rw-r--r-- | onboarding-1.png | bin | 0 -> 114484 bytes | |||
-rw-r--r-- | pages/CreateProfile.qml | 18 | ||||
-rw-r--r-- | pages/CreateProfileForm.ui.qml | 2 | ||||
-rw-r--r-- | pages/EmailForm.ui.qml | 2 | ||||
-rw-r--r-- | pages/LoginName.qml | 19 | ||||
-rw-r--r-- | pages/LoginPass.qml | 20 | ||||
-rw-r--r-- | pages/PasswordForm.ui.qml | 2 | ||||
-rw-r--r-- | pages/Profile.qml | 16 |
24 files changed, 209 insertions, 177 deletions
diff --git a/pages/ConfirmPassword.qml b/ConfirmPassword.qml index 6d37be7..88618a3 100644 --- a/pages/ConfirmPassword.qml +++ b/ConfirmPassword.qml @@ -1,11 +1,15 @@ import QtQuick 2.12 import KelakonUser 0.1 +import "pages" PasswordForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + userEmail.y: 292 + passImage.source: "larva/components/icons/lock-24px.svg" instructionLabel.text: qsTr("Re-Enter password") emailAddressLabel.text: User.name @@ -19,6 +23,6 @@ PasswordForm { createPassButton { enabled: false text: qsTr("Confirm password") - onClicked: stackView.push("qrc:/pages/CreateProfile.qml") + onClicked: pageView.push("CreateProfile.qml") } } diff --git a/CreateProfile.qml b/CreateProfile.qml new file mode 100644 index 0000000..16176ba --- /dev/null +++ b/CreateProfile.qml @@ -0,0 +1,20 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "pages" + +CreateProfileForm { + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + + skipButton.onClicked: pageView.push("Home.qml") + emailImage.source: "larva/components/icons/email-24px.svg" + emailAddressLabel.text: User.emailAddress + startUsingKelakon.onClicked: { + User.name = userNameLabel.text + User.realName = enterFullName.text + onboarding.ticketNew("Kelakon", User.realName + " <" + User.emailAddress + + ">") + } +} diff --git a/pages/Email.qml b/Email.qml index 0919437..5ab8953 100644 --- a/pages/Email.qml +++ b/Email.qml @@ -1,10 +1,14 @@ import QtQuick 2.12 import KelakonUser 0.1 +import "pages" EmailForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + + emailImage.source: "larva/components/icons/email-24px.svg" emailTextField.onTextChanged: { if (!emailTextField.text || !loginButton.enabled) @@ -13,6 +17,6 @@ EmailForm { loginButton.onClicked: { User.emailAddress = emailTextField.text - stackView.push("qrc:/pages/Password.qml") + pageView.push("Password.qml") } } diff --git a/pages/Home.qml b/Home.qml index 533b1b8..99448d2 100644 --- a/pages/Home.qml +++ b/Home.qml @@ -1,7 +1,6 @@ import QtQuick 2.12 +import "pages" HomeForm { - width: stackView.width - height: stackView.height menuButton.onClicked: drawer.visible = !drawer.visible } @@ -1,18 +1,32 @@ import QtQuick 2.12 -import "larva/features" +import QtQuick.Controls 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Layouts 1.12 -OnboardingForm { - signal logIn(string name, string password) - signal ticketNew(string queue, string requestor) - signal ticketSearch(string name) - function pushProfile() { - stackView.push("qrc:/pages/Profile.qml") +Page { + header: ToolBar { + background: Rectangle { + color: "#FAFFFFFF" + } + RowLayout { + ToolButton { + id: toolButton + icon.name: "back-button" + icon.source: "larva/components/icons/arrow-back-24px.svg" + highlighted: true + onClicked: + if (pageView.depth > 1) + pageView.pop() + else + drawer.open() + } + } } - objectName: "login" - width: appWindow.width - height: appWindow.height - logoImage.source: "kelakon-logo.png" - registerButton.onClicked: stackView.push("qrc:/pages/Email.qml") - loginButton.onClicked: stackView.push("qrc:/pages/LoginName.qml") + StackView { + id: contentView + anchors.topMargin: 432 + anchors.fill: parent + initialItem: LoginEmail{} + } } diff --git a/LoginEmail.qml b/LoginEmail.qml new file mode 100644 index 0000000..d699e19 --- /dev/null +++ b/LoginEmail.qml @@ -0,0 +1,18 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "larva/features" + +LoginEmailForm { + emailTextField.onTextChanged: { + if (!emailTextField.text || !continueButton.enabled) + continueButton.enabled = !continueButton.enabled + } + + continueButton { + icon.source: "assets/arrow-forward-24px.svg" + onClicked: { + User.name = emailTextField.text + contentView.push("LoginPassword.qml") + } + } +} diff --git a/LoginPassword.qml b/LoginPassword.qml new file mode 100644 index 0000000..5e510d2 --- /dev/null +++ b/LoginPassword.qml @@ -0,0 +1,20 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "larva/features" + +LoginPasswordForm { + emailTextLabel.text: User.name + + passwordTextField.onTextChanged: { + if (!passwordTextField.text || !continueButton.enabled) + continueButton.enabled = !continueButton.enabled + } + + continueButton { + icon.source: "assets/arrow-forward-24px.svg" + onClicked: { + User.password = passwordTextField.text + onClicked: onboarding.logIn(User.name, User.password) + } + } +} diff --git a/Onboarding.qml b/Onboarding.qml new file mode 100644 index 0000000..291f3c9 --- /dev/null +++ b/Onboarding.qml @@ -0,0 +1,16 @@ +import QtQuick 2.12 +import "larva/features" + +OnboardingForm { + signal logIn(string name, string password) + signal ticketNew(string queue, string requestor) + signal ticketSearch(string name) + function pushProfile() { + pageView.push("Profile.qml") + } + + objectName: "onboarding" + logoImage.source: "kelakon-logo.png" + registerButton.onClicked: pageView.push("Email.qml") + loginButton.onClicked: pageView.push("Login.qml") +} diff --git a/pages/Password.qml b/Password.qml index 0b042c5..6792c1e 100644 --- a/pages/Password.qml +++ b/Password.qml @@ -1,10 +1,14 @@ import QtQuick 2.12 import KelakonUser 0.1 +import "pages" PasswordForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + + passImage.source: "larva/components/icons/lock-24px.svg" emailAddressLabel.text: User.name passTextField.onTextChanged: { @@ -14,6 +18,6 @@ PasswordForm { createPassButton.onClicked: { User.password = passTextField.text - stackView.push("qrc:/pages/ConfirmPassword.qml") + pageView.push("ConfirmPassword.qml") } } diff --git a/Profile.qml b/Profile.qml new file mode 100644 index 0000000..d0d258c --- /dev/null +++ b/Profile.qml @@ -0,0 +1,19 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "pages" + +CreateProfileForm { + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + titleLabel.text: qsTr("Edit Profile") + skipButton.onClicked: { + onboarding.ticketSearch(User.name) + pageView.push("Home.qml") + } + emailImage.source: "larva/components/icons/email-24px.svg" + enterFullName.text: User.realName + userNameLabel.text: User.name + emailAddressLabel.text: User.emailAddress +} diff --git a/assets/arrow-back-24px.svg b/assets/arrow-forward-24px.svg index 9d5f05f..842e7d0 100644 --- a/assets/arrow-back-24px.svg +++ b/assets/arrow-forward-24px.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>
\ No newline at end of file +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z"/></svg>
\ No newline at end of file diff --git a/assets/email-24px.svg b/assets/email-24px.svg deleted file mode 100644 index 1ed4686..0000000 --- a/assets/email-24px.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"/></svg>
\ No newline at end of file diff --git a/assets/lock-24px.svg b/assets/lock-24px.svg deleted file mode 100644 index 1dbceea..0000000 --- a/assets/lock-24px.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none"><path d="M0 0h24v24H0V0z"/><path opacity=".87" d="M0 0h24v24H0V0z"/></g><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/></svg>
\ No newline at end of file diff --git a/controller.cxx b/controller.cxx index c9403dd..82e439d 100644 --- a/controller.cxx +++ b/controller.cxx @@ -14,16 +14,16 @@ Controller::Controller(QObject* parent) : QObject{parent} auto rootObjects = engine->rootObjects(); auto appWindow = rootObjects[0]; - auto loginView = appWindow->findChild<QObject*>("login"); - connect(loginView, SIGNAL(logIn(QString, QString)) + auto onboardingView = appWindow->findChild<QObject*>("onboarding"); + connect(onboardingView, SIGNAL(logIn(QString, QString)) , client, SLOT(logIn(QString, QString))); connect(client, SIGNAL(loggedIn(QString)) , client, SLOT(userShow(QString))); connect(client, SIGNAL(userShown(rtclient_user*)) - , loginView, SLOT(pushProfile())); - connect(loginView, SIGNAL(ticketNew(QString, QString)) + , onboardingView, SLOT(pushProfile())); + connect(onboardingView, SIGNAL(ticketNew(QString, QString)) , client, SLOT(ticketNew(QString, QString))); - connect(loginView, SIGNAL(ticketSearch(QString)) + connect(onboardingView, SIGNAL(ticketSearch(QString)) , client, SLOT(ticketSearch(QString))); using RTClient::User; diff --git a/kelakon.qrc b/kelakon.qrc index 4e22d9e..e216def 100644 --- a/kelakon.qrc +++ b/kelakon.qrc @@ -1,55 +1,39 @@ <RCC> - <qresource prefix="/"> - <file>main.qml</file> - <file>Login.qml</file> - <file>larva/features/OnboardingForm.ui.qml</file> - <file>kelakon-logo.png</file> - <file>larva/components/images/onboarding-1.png</file> - <file>pages/Email.qml</file> - <file>pages/EmailForm.ui.qml</file> - <file>assets/arrow-back-24px.svg</file> - <file>pages/Password.qml</file> - <file>pages/PasswordForm.ui.qml</file> - <file>qtquickcontrols2.conf</file> - <file>pages/ExistingLogin.qml</file> - <file>pages/ExistingLoginForm.ui.qml</file> - <file>pages/ConfirmPassword.qml</file> - <file>pages/CreateProfile.qml</file> - <file>pages/CreateProfileForm.ui.qml</file> - <file>pages/TaskForm.ui.qml</file> - <file>pages/TaskList.qml</file> - <file>pages/TaskListForm.ui.qml</file> - <file>assets/photo_camera_24px.svg</file> - <file>pages/Home.qml</file> - <file>pages/HomeForm.ui.qml</file> - <file>assets/menu-24px.svg</file> - <file>assets/check-box-outline-24px.svg</file> - <file>assets/chevron-right-24px.svg</file> - <file>assets/add-24px.svg</file> - <file>assets/profile-24px.svg</file> - <file>pages/Username.qml</file> - <file>pages/UsernameForm.ui.qml</file> - <file>assets/user-24px.svg</file> - <file>assets/email-24px.svg</file> - <file>assets/lock-24px.svg</file> - <file>pages/LoginName.qml</file> - <file>pages/LoginPass.qml</file> - <file>pages/Profile.qml</file> - <file>larva/components/layout/Card.qml</file> - <file>larva/components/layout/CardForm.ui.qml</file> - <file>larva/features/EnterPassword.qml</file> - <file>larva/features/EnterPasswordForm.ui.qml</file> - <file>larva/features/Login.qml</file> - <file>larva/features/LoginEmail.qml</file> - <file>larva/features/LoginEmailForm.ui.qml</file> - <file>larva/features/LoginPassword.qml</file> - <file>larva/features/LoginPasswordForm.ui.qml</file> - <file>larva/features/Onboarding.qml</file> - <file>larva/HomeForm.ui.qml</file> - <file>larva/LICENSE</file> - <file>larva/main.qml</file> - <file>larva/Page1Form.ui.qml</file> - <file>larva/Page2Form.ui.qml</file> - <file>larva/README.md</file> - </qresource> + <qresource prefix="/"> + <file>main.qml</file> + <file>Onboarding.qml</file> + <file>larva/features/OnboardingForm.ui.qml</file> + <file>kelakon-logo.png</file> + <file>larva/components/images/onboarding-1.png</file> + <file>Login.qml</file> + <file>larva/components/icons/arrow-back-24px.svg</file> + <file>LoginEmail.qml</file> + <file>larva/features/LoginEmailForm.ui.qml</file> + <file>assets/arrow-forward-24px.svg</file> + <file>larva/components/icons/email-24px.svg</file> + <file>LoginPassword.qml</file> + <file>larva/features/LoginPasswordForm.ui.qml</file> + <file>larva/components/icons/lock-24px.svg</file> + <file>Profile.qml</file> + <file>Email.qml</file> + <file>pages/EmailForm.ui.qml</file> + <file>Password.qml</file> + <file>pages/PasswordForm.ui.qml</file> + <file>ConfirmPassword.qml</file> + <file>CreateProfile.qml</file> + <file>pages/CreateProfileForm.ui.qml</file> + <file>Home.qml</file> + <file>pages/HomeForm.ui.qml</file> + <file>pages/TaskForm.ui.qml</file> + <file>pages/TaskList.qml</file> + <file>pages/TaskListForm.ui.qml</file> + <file>assets/photo_camera_24px.svg</file> + <file>assets/menu-24px.svg</file> + <file>assets/check-box-outline-24px.svg</file> + <file>assets/chevron-right-24px.svg</file> + <file>assets/add-24px.svg</file> + <file>assets/profile-24px.svg</file> + <file>assets/user-24px.svg</file> + <file>qtquickcontrols2.conf</file> + </qresource> </RCC> @@ -1,23 +1,22 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 -import QtQuick.Layouts 1.12 -import "larva/features" ApplicationWindow { - id: window - visible: true - width: 360 - height: 640 - title: { - text: qsTr("kelakon") - } + id: window + visible: true + width: 360 + height: 640 + title: { + text: qsTr("kelakon") + } - - StackView { - id: pageView - anchors.fill: parent - - initialItem: Onboarding {} - } + StackView { + property alias onboarding: onboarding + id: pageView + anchors.fill: parent + initialItem: Onboarding { + id: onboarding + } + } } diff --git a/onboarding-1.png b/onboarding-1.png Binary files differnew file mode 100644 index 0000000..dce5270 --- /dev/null +++ b/onboarding-1.png diff --git a/pages/CreateProfile.qml b/pages/CreateProfile.qml deleted file mode 100644 index 7d499e2..0000000 --- a/pages/CreateProfile.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -CreateProfileForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - skipButton.onClicked: { - stackView.push("qrc:/pages/Home.qml") - } - emailAddressLabel.text: User.emailAddress - startUsingKelakon.onClicked: { - User.name = userNameLabel.text - User.realName = enterFullName.text - login.ticketNew("Kelakon", User.realName + " <" + User.emailAddress - + ">") - } -} diff --git a/pages/CreateProfileForm.ui.qml b/pages/CreateProfileForm.ui.qml index ac594c8..2eec4d7 100644 --- a/pages/CreateProfileForm.ui.qml +++ b/pages/CreateProfileForm.ui.qml @@ -12,6 +12,7 @@ Rectangle { property alias skipButton: skipButton property alias enterFullName: enterFullName property alias userNameLabel: userNameLabel + property alias emailImage: emailImage property alias emailAddressLabel: emailAddressLabel property alias startUsingKelakon: startUsingKelakon @@ -74,6 +75,7 @@ Rectangle { spacing: 8 Image { + id: emailImage width: 24 height: 24 opacity: 0.54 diff --git a/pages/EmailForm.ui.qml b/pages/EmailForm.ui.qml index 26f124c..0f22dbc 100644 --- a/pages/EmailForm.ui.qml +++ b/pages/EmailForm.ui.qml @@ -10,6 +10,7 @@ Rectangle { property alias backButton: backButton property alias instructionLabel: instructionLabel + property alias emailImage: emailImage property alias emailTextField: emailTextField property alias loginButton: loginButton @@ -74,6 +75,7 @@ Rectangle { spacing: 8 Image { + id: emailImage width: 24 height: 24 opacity: 0.54 diff --git a/pages/LoginName.qml b/pages/LoginName.qml deleted file mode 100644 index 9294056..0000000 --- a/pages/LoginName.qml +++ /dev/null @@ -1,19 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -EmailForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - instructionLabel.text: qsTr("Enter your email") - - emailTextField.onTextChanged: { - if (!emailTextField.text || !loginButton.enabled) - loginButton.enabled = !loginButton.enabled - } - - loginButton.onClicked: { - User.name = emailTextField.text - stackView.push("qrc:/pages/LoginPass.qml") - } -} diff --git a/pages/LoginPass.qml b/pages/LoginPass.qml deleted file mode 100644 index 9e5d2f4..0000000 --- a/pages/LoginPass.qml +++ /dev/null @@ -1,20 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -PasswordForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - instructionLabel.text: qsTr("Enter password") - emailAddressLabel.text: User.name - - passTextField.onTextChanged: { - if (!passTextField.text || !createPassButton.enabled) - createPassButton.enabled = !createPassButton.enabled - } - - createPassButton.onClicked: { - User.password = passTextField.text - onClicked: login.logIn(User.name, User.password) - } -} diff --git a/pages/PasswordForm.ui.qml b/pages/PasswordForm.ui.qml index d4849fd..011af8c 100644 --- a/pages/PasswordForm.ui.qml +++ b/pages/PasswordForm.ui.qml @@ -11,6 +11,7 @@ Rectangle { property alias backButton: backButton property alias instructionLabel: instructionLabel property alias userEmail: userEmail + property alias passImage: passImage property alias passTextField: passTextField property alias createPassButton: createPassButton property alias emailAddressLabel: emailAddressLabel @@ -107,6 +108,7 @@ Rectangle { height: 56 Image { + id: passImage width: 24 height: 24 opacity: 0.54 diff --git a/pages/Profile.qml b/pages/Profile.qml deleted file mode 100644 index b72b108..0000000 --- a/pages/Profile.qml +++ /dev/null @@ -1,16 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -CreateProfileForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - titleLabel.text: qsTr("Edit Profile") - skipButton.onClicked: { - login.ticketSearch(User.name) - stackView.push("qrc:/pages/Home.qml") - } - enterFullName.text: User.realName - userNameLabel.text: User.name - emailAddressLabel.text: User.emailAddress -} |