Choice model settings was added
This commit is contained in:
31
qml/main.qml
31
qml/main.qml
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user