This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
fanny-app/qml/MainPage.qml

85 lines
2.2 KiB
QML
Raw Normal View History

2018-06-21 08:47:09 +02:00
import QtQuick 2.9
import QtQuick.Controls 2.2
Page {
id: root
anchors.fill: parent
2018-06-21 16:41:02 +02:00
header: AppToolBar {
2018-06-21 08:47:09 +02:00
contentHeight: toolButton.implicitHeight
ToolButton {
id: toolButton
2018-06-21 16:41:02 +02:00
text: stackView.depth > 1 ? "\u25C0" : "\u4E09"
2018-06-21 08:47:09 +02:00
font.pixelSize: Qt.application.font.pixelSize * 1.6
2018-06-21 16:41:02 +02:00
2018-06-21 08:47:09 +02:00
onClicked: {
2018-06-21 16:41:02 +02:00
console.log(toolButton.font.styleName)
2018-06-21 08:47:09 +02:00
if (stackView.depth > 1) {
stackView.pop()
} else {
drawer.open()
}
}
}
Label {
text: stackView.currentItem.title
anchors.centerIn: parent
}
}
Drawer {
id: drawer
width: window.width * 0.66
height: window.height
Column {
anchors.fill: parent
ItemDelegate {
2018-06-21 16:41:02 +02:00
text: qsTr("Fanny Webseite")
2018-06-21 08:47:09 +02:00
width: parent.width
onClicked: {
2018-06-21 16:41:02 +02:00
stackView.push("WebsitePage.qml")
2018-06-21 08:47:09 +02:00
drawer.close()
}
}
ItemDelegate {
2018-06-21 16:41:02 +02:00
text: qsTr("abmelden")
2018-06-21 08:47:09 +02:00
width: parent.width
onClicked: {
2018-06-21 16:41:02 +02:00
confirmationDialog.open()
}
Dialog {
id: confirmationDialog
x: (window.width - width) / 2
y: (window.height - height) / 2
parent: ApplicationWindow.overlay
modal: true
standardButtons: Dialog.Cancel | Dialog.Ok
Column {
spacing: 20
anchors.fill: parent
Label {
text: "Möchtest du dich wirklich abmelden?"
}
}
onAccepted: {
_cppServerConn.logout()
drawer.close()
root.StackView.view.push("LoginPage.qml")
}
2018-06-21 08:47:09 +02:00
}
}
}
}
StackView {
id: stackView
initialItem: "HomeForm.qml"
anchors.fill: parent
}
}