diff options
Diffstat (limited to 'main.qml')
-rw-r--r-- | main.qml | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/main.qml b/main.qml new file mode 100644 index 0000000..12054cf --- /dev/null +++ b/main.qml @@ -0,0 +1,80 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Layouts 1.12 + +ApplicationWindow { + id: window + visible: true + width: 360 + height: 640 + title: { + text: qsTr("kelakon") + } + header: + ToolBar { + Material.elevation: 0 + background: Rectangle { + color: "#FAFFFFFF" + } + RowLayout { + ToolButton { + id: toolButton + icon.name: "menu-button" + icon.source: "components/icons/menu-24px.svg" + highlighted: true + onClicked: { + if (stackView.depth > 1) { + stackView.pop() + } else { + drawer.open() + } + } + } + + Label { + text: stackView.currentItem.title + font.family: "Work Sans" + font.weight: Font.Medium + font.pointSize: 20 + wrapMode: Text.WordWrap + elide: Label.ElideRight + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + } + } + } + + Drawer { + id: drawer + width: window.width * 0.8 + height: window.height + + Column { + anchors.fill: parent + + ItemDelegate { + text: qsTr("Page 1") + width: parent.width + onClicked: { + stackView.push("Page1Form.ui.qml") + drawer.close() + } + } + ItemDelegate { + text: qsTr("Page 2") + width: parent.width + onClicked: { + stackView.push("Page2Form.ui.qml") + drawer.close() + } + } + } + } + + StackView { + id: stackView + initialItem: "HomeForm.ui.qml" + anchors.fill: parent + } +} |