Styles was added

This commit is contained in:
2023-03-29 12:49:20 +02:00
parent 7a929eb757
commit 44dd3cdb58
26 changed files with 433 additions and 193 deletions

94
qml/main.qml Normal file
View File

@@ -0,0 +1,94 @@
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtWebSockets
import ru.ded.beerlog 1.0
import "Components"
ApplicationWindow {
width: 640
height: 480
visible: true
title: qsTr("Beer Log")
header: ToolBar {
RowLayout {
anchors.fill: parent
MenuBackButton {
state: "menu"//stackView.depth > 1 ? "back" : "menu"
onClicked: drawer.open()
onBack: {
state = "menu"
}
}
ToolButton {
text: usersModel.selectedUserName
Layout.fillWidth: true
onClicked: usersMenu.open()
}
}
Menu {
id: usersMenu
UsersViewModel {
id: usersModel
}
Repeater {
model: usersModel.users
MenuItem {
text: modelData.name
onClicked: {
usersModel.selectedUser = modelData.id
}
}
}
}
}
Drawer {
id: drawer
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"
}
Label {
anchors.verticalCenter: parent.verticalCenter
font.pointSize: 20
text: qsTr("BeerLog v0.1")
}
}
ItemDelegate {
text: qsTr("Settings")
width: parent.width
onClicked: stackView.openPage("SettingsForm.qml")
}
ItemDelegate {
text: qsTr("Quit")
width: parent.width
onClicked: Qt.quit()
}
}
}
}