Initial commit
This commit is contained in:
69
main.qml
Normal file
69
main.qml
Normal file
@@ -0,0 +1,69 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
ApplicationWindow {
|
||||
id: window
|
||||
visible: true
|
||||
width: 640
|
||||
height: 480
|
||||
title: qsTr("Stack")
|
||||
|
||||
header: ToolBar {
|
||||
contentHeight: 36
|
||||
|
||||
MenuBackButton {
|
||||
id: menuButton
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 8
|
||||
|
||||
width: 24
|
||||
height: 24
|
||||
|
||||
state: stackView.depth > 1 ? "back" : "menu"
|
||||
|
||||
onClicked: {
|
||||
drawer.open()
|
||||
}
|
||||
|
||||
onBack: {
|
||||
stackView.pop()
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: stackView.currentItem.title
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
||||
Drawer {
|
||||
id: drawer
|
||||
width: window.width * 0.66
|
||||
height: window.height
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
|
||||
ItemDelegate {
|
||||
text: qsTr("Settings")
|
||||
width: parent.width
|
||||
onClicked: {
|
||||
if (stackView.depth > 1) {
|
||||
stackView.pop()
|
||||
}
|
||||
|
||||
stackView.push("SettingsForm.qml")
|
||||
drawer.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StackView {
|
||||
id: stackView
|
||||
initialItem: "HomeForm.qml"
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user