From bcb1e44f4a4f9b7927e5ab0e29b90654d0cd0379 Mon Sep 17 00:00:00 2001 From: Anatasof Wirapraja Date: Fri, 20 Sep 2019 11:57:47 +0700 Subject: `home.qml` now user `header` and `footer` --- Home.qml | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 80 insertions(+), 5 deletions(-) diff --git a/Home.qml b/Home.qml index 27f1fd0..f125141 100644 --- a/Home.qml +++ b/Home.qml @@ -1,10 +1,85 @@ import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Layouts 1.12 import "pages" -HomeForm { - menuButton.onClicked: drawer.visible = !drawer.visible +Page { + header: ToolBar { + background: Rectangle { + color: "#FAFFFFFF" + } + RowLayout { + anchors.fill: parent + spacing: 0 + ToolButton { + id: menuButton + Layout.rightMargin: 0 + Layout.preferredHeight: -1 + Layout.preferredWidth: -1 + padding: 0 + rightPadding: 0 + leftPadding: 0 + bottomPadding: 0 + topPadding: 0 + icon.name: "menu-button" + icon.source: "larva/components/icons/menu-24px.svg" + highlighted: true + onClicked: { + drawer.open() + } + } + Label { + text: contentView.currentItem.title + 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 - TaskList { - anchors.top: toolbar.bottom - } + } + } + } + footer: RowLayout { + RoundButton { + id: roundButton + width: 64 + height: 64 + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + Layout.minimumHeight: 64 + Layout.minimumWidth: 64 + display: AbstractButton.IconOnly + spacing: 8 + + padding: 16 + highlighted: true + + icon.name: "add-icon" + icon.source: "/assets/add-24px.svg" + } + } + + Drawer { + id: drawer + width: window.width * 0.8 + height: window.height + visible: false + } + + StackView { + id: contentView + anchors.fill: parent + initialItem: HomeForm {} + } +} + + +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} } +##^##*/ -- cgit v1.2.3