diff options
-rw-r--r-- | HomeForm.ui.qml | 11 | ||||
-rw-r--r-- | Page1Form.ui.qml | 11 | ||||
-rw-r--r-- | Page2Form.ui.qml | 11 | ||||
-rw-r--r-- | components/layout/Card.qml | 4 | ||||
-rw-r--r-- | components/layout/CardForm.ui.qml | 9 | ||||
-rw-r--r-- | main.qml | 80 |
6 files changed, 126 insertions, 0 deletions
diff --git a/HomeForm.ui.qml b/HomeForm.ui.qml new file mode 100644 index 0000000..2e717d9 --- /dev/null +++ b/HomeForm.ui.qml @@ -0,0 +1,11 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.5 + +Page { + title: qsTr("Today") + + Label { + text: qsTr("You are on the home page.") + anchors.centerIn: parent + } +} diff --git a/Page1Form.ui.qml b/Page1Form.ui.qml new file mode 100644 index 0000000..1f822a0 --- /dev/null +++ b/Page1Form.ui.qml @@ -0,0 +1,11 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.5 + +Page { + title: qsTr("Page 1") + + Label { + text: qsTr("You are on Page 1.") + anchors.centerIn: parent + } +} diff --git a/Page2Form.ui.qml b/Page2Form.ui.qml new file mode 100644 index 0000000..9081c7c --- /dev/null +++ b/Page2Form.ui.qml @@ -0,0 +1,11 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.5 + +Page { + title: qsTr("Page 2") + + Label { + text: qsTr("You are on Page 2.") + anchors.centerIn: parent + } +} diff --git a/components/layout/Card.qml b/components/layout/Card.qml new file mode 100644 index 0000000..3fe3b1a --- /dev/null +++ b/components/layout/Card.qml @@ -0,0 +1,4 @@ +import QtQuick 2.4 + +CardForm { +} diff --git a/components/layout/CardForm.ui.qml b/components/layout/CardForm.ui.qml new file mode 100644 index 0000000..85e9d00 --- /dev/null +++ b/components/layout/CardForm.ui.qml @@ -0,0 +1,9 @@ +import QtQuick 2.4 + +Item {} + +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ 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 + } +} |