82 lines
2.2 KiB
QML
82 lines
2.2 KiB
QML
|
// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
|
||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||
|
|
||
|
import QtQuick
|
||
|
import QtQuick.Controls
|
||
|
import QtQuick.Layouts
|
||
|
|
||
|
Item {
|
||
|
property string currentPage: "home"
|
||
|
RowLayout {
|
||
|
anchors.fill: parent
|
||
|
|
||
|
Column {
|
||
|
id: menu
|
||
|
Layout.fillWidth: true
|
||
|
Layout.minimumWidth: 50
|
||
|
Layout.preferredWidth: 100
|
||
|
Layout.maximumWidth: 100
|
||
|
Layout.alignment: Qt.AlignTop
|
||
|
|
||
|
MenuItem {
|
||
|
width: parent.width
|
||
|
text: qsTr("Home")
|
||
|
icon.name: "home"
|
||
|
highlighted: currentPage === "home"
|
||
|
onTriggered: {
|
||
|
if (!this.highlighted)
|
||
|
content.replace(home)
|
||
|
}
|
||
|
}
|
||
|
MenuItem {
|
||
|
width: parent.width
|
||
|
text: qsTr("Assets")
|
||
|
icon.name: "document-properties"
|
||
|
highlighted: currentPage === "assets"
|
||
|
onTriggered: {
|
||
|
if (!this.highlighted)
|
||
|
content.replace(assets)
|
||
|
}
|
||
|
}
|
||
|
MenuItem {
|
||
|
width: parent.width
|
||
|
text: qsTr("Records")
|
||
|
icon.name: "system-search"
|
||
|
highlighted: currentPage === "records"
|
||
|
onTriggered: {
|
||
|
if (!this.highlighted)
|
||
|
content.replace(records)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
StackView {
|
||
|
id: content
|
||
|
initialItem: home
|
||
|
Layout.fillWidth: true
|
||
|
Layout.fillHeight: true
|
||
|
|
||
|
Component {
|
||
|
id: home
|
||
|
Home {
|
||
|
StackView.onActivating: currentPage = "home"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Component {
|
||
|
id: assets
|
||
|
Assets {
|
||
|
StackView.onActivating: currentPage = "assets"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Component {
|
||
|
id: records
|
||
|
Records {
|
||
|
StackView.onActivating: currentPage = "records"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|