From c35b90e20259b61672f7a35e089b46c07b038d67 Mon Sep 17 00:00:00 2001 From: Anatasof Wirapraja Date: Mon, 7 Dec 2020 10:38:36 +0700 Subject: home form uses toolbar --- main.qml | 2 +- pages/Home.qml | 13 +++++++++++++ pages/HomeForm.ui.qml | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- qml.qrc | 3 ++- qtquickcontrols2.conf | 2 +- 5 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 pages/Home.qml diff --git a/main.qml b/main.qml index 4ae99f0..37c80aa 100644 --- a/main.qml +++ b/main.qml @@ -15,7 +15,7 @@ ApplicationWindow { OnboardingForm { id: pageView anchors.fill: parent - startButton.onClicked: pageView.push("pages/GetStarted.qml") + startButton.onClicked: pageView.push("pages/Home.qml") onboardingText1.text: qsTr("Everything you need to sell online.") onboardingText2.text: qsTr("Set up your store in minutes and bring your brand to life") disclaimerText.text: qsTr("By tapping 'Get started' and using this app, you're agreeing to our terms of service and privacy policy") diff --git a/pages/Home.qml b/pages/Home.qml new file mode 100644 index 0000000..868e55f --- /dev/null +++ b/pages/Home.qml @@ -0,0 +1,13 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.12 + +HomeForm { + +} + +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ diff --git a/pages/HomeForm.ui.qml b/pages/HomeForm.ui.qml index 2df9430..02c502d 100644 --- a/pages/HomeForm.ui.qml +++ b/pages/HomeForm.ui.qml @@ -1,12 +1,54 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.12 Page { + property alias menuButton: menuButton + property alias profileButton: profileButton + property alias contentView: contentView - title: qsTr("Home") + header: ToolBar { + background: Rectangle { + color: "transparent" + } + RowLayout { + anchors.fill: parent + spacing: 0 + ToolButton { + id: menuButton + icon.name: "menu-button" + icon.source: "../icons/menu-24px.svg" + highlighted: true + } + Label { + text: "Today" + Layout.leftMargin: 16 + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + wrapMode: Text.WordWrap + font.family: "Work Sans" + font.weight: Font.Medium + font.pointSize: 20 + color: "#000000" + Layout.fillWidth: true + } + ToolButton { + id: profileButton + icon.name: "profile-button" + icon.source: "../icons/profile-24px.svg" + highlighted: true + } + } + } - Label { - text: qsTr("You are on the home page.") - anchors.centerIn: parent + StackView { + id: contentView + anchors.fill: parent } } +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ + diff --git a/qml.qrc b/qml.qrc index 9581a80..a4617f1 100644 --- a/qml.qrc +++ b/qml.qrc @@ -8,7 +8,6 @@ pages/GetStartedForm.ui.qml pages/Onboarding.qml pages/OnboardingForm.ui.qml - pages/HomeForm.ui.qml icons/add-24px.svg icons/arrow-back-24px.svg icons/arrow-forward-24px.svg @@ -25,5 +24,7 @@ icons/photo_camera_24px.svg icons/profile-24px.svg icons/user-24px.svg + pages/Home.qml + pages/HomeForm.ui.qml diff --git a/qtquickcontrols2.conf b/qtquickcontrols2.conf index 069c1db..3294845 100644 --- a/qtquickcontrols2.conf +++ b/qtquickcontrols2.conf @@ -2,6 +2,6 @@ Style=Material [Material] -Theme=Light Accent=Cyan Primary=BlueGrey +Theme=Light -- cgit v1.2.3