Choice model settings was added

This commit is contained in:
2023-04-10 19:24:25 +02:00
parent 25e8a3ea79
commit 4a52926be9
31 changed files with 938 additions and 227 deletions

View File

@@ -26,6 +26,7 @@ ApplicationWindow {
Label {
text: stackView.currentItem.title || usersModel.selectedUserName
Layout.fillWidth: true
Layout.minimumWidth: 100
horizontalAlignment: Qt.AlignCenter
MouseArea {
@@ -55,24 +56,46 @@ ApplicationWindow {
}
}
}
Menu {
id: storesMenu
StoresViewModel {
id: storesModel
}
Repeater {
model: storesModel.stores
MenuItem {
text: modelData.name
onClicked: {
storesModel.selectedStore = modelData.id
}
}
}
}
}
MainMenu {
id: mainMenu
readonly property var actions: {
"orders": () => { stackView.openPage("Views/OrdersView.qml") },
"settings": () => { stackView.openPage("Views/SettingsView.qml") },
"quit": () => { Qt.quit() }
}
width: parent.width * 0.66
height: parent.height
logo: "qrc:/logo.png"
appName: qsTr("BeerLog v0.1")
connected: beerService.connected
model: ListModel {
ListElement {
title: qsTr("Orders")
action: "orders"
}
ListElement {
title: qsTr("Settings")
action: "settings"
@@ -88,7 +111,7 @@ ApplicationWindow {
StackView {
id: stackView
initialItem: "Views/OrdersView.qml"
initialItem: "Views/ProductsView.qml"
anchors.fill: parent
function openPage(page) {