|
|
@@ -18,7 +18,7 @@ ApplicationWindow {
|
|
|
anchors.fill: parent
|
|
|
MenuBackButton {
|
|
|
state: "menu"//stackView.depth > 1 ? "back" : "menu"
|
|
|
- onClicked: drawer.open()
|
|
|
+ onClicked: mainMenu.open()
|
|
|
onBack: {
|
|
|
state = "menu"
|
|
|
}
|
|
|
@@ -51,44 +51,31 @@ ApplicationWindow {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Drawer {
|
|
|
- id: drawer
|
|
|
+ MainMenu {
|
|
|
+ id: mainMenu
|
|
|
+
|
|
|
+ readonly property var actions: {
|
|
|
+ "settings": () => { stackView.openPage("SettingsForm.qml") },
|
|
|
+ "quit": () => { Qt.quit() }
|
|
|
+ }
|
|
|
|
|
|
width: parent.width * 0.66
|
|
|
height: parent.height
|
|
|
|
|
|
- Column {
|
|
|
- anchors.fill: parent
|
|
|
-
|
|
|
- Row {
|
|
|
- width: parent.width
|
|
|
- height: 100
|
|
|
-
|
|
|
- Image {
|
|
|
- anchors.top: parent.top
|
|
|
- anchors.bottom: parent.bottom
|
|
|
- anchors.margins: 10
|
|
|
- source: "logo.png"
|
|
|
- }
|
|
|
+ logo: "qrc:/logo.png"
|
|
|
+ appName: qsTr("BeerLog v0.1")
|
|
|
|
|
|
- Label {
|
|
|
- anchors.verticalCenter: parent.verticalCenter
|
|
|
- font.pointSize: 20
|
|
|
- text: qsTr("BeerLog v0.1")
|
|
|
- }
|
|
|
+ model: ListModel {
|
|
|
+ ListElement {
|
|
|
+ title: qsTr("Settings")
|
|
|
+ action: "settings"
|
|
|
}
|
|
|
-
|
|
|
- ItemDelegate {
|
|
|
- text: qsTr("Settings")
|
|
|
- width: parent.width
|
|
|
- onClicked: stackView.openPage("SettingsForm.qml")
|
|
|
- }
|
|
|
-
|
|
|
- ItemDelegate {
|
|
|
- text: qsTr("Quit")
|
|
|
- width: parent.width
|
|
|
- onClicked: Qt.quit()
|
|
|
+ ListElement {
|
|
|
+ title: qsTr("Quit")
|
|
|
+ action: "quit"
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ onActionSelected: (action) => actions[action]()
|
|
|
}
|
|
|
}
|