status-desktop/ui/app/AppLayouts/Profile/LeftTab/Menu.qml

73 lines
2.2 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import StatusQ.Components 0.1
2020-05-27 20:57:36 +00:00
import "../../../../imports"
import "./constants.js" as ProfileConstants
2020-05-27 20:57:36 +00:00
ScrollView {
property var changeProfileSection: function (sectionId) {
Config.currentMenuTab = sectionId
}
ScrollBar.horizontal.policy: Qt.ScrollBarAlwaysOff
contentHeight: menuItems.height + 24
2020-05-27 20:57:36 +00:00
id: profileMenu
2021-03-25 18:12:33 +00:00
clip: true
Column {
id: menuItems
spacing: 4
Repeater {
model: ProfileConstants.mainMenuButtons
delegate: StatusNavigationListItem {
itemId: modelData.id
title: modelData.text
icon.name: modelData.icon
selected: Config.currentMenuTab === modelData.id
onClicked: Config.currentMenuTab = modelData.id
}
}
StatusListSectionHeadline { text: "Settings" }
Repeater {
model: ProfileConstants.settingsMenuButtons
delegate: StatusNavigationListItem {
itemId: modelData.id
title: modelData.text
icon.name: modelData.icon
selected: Config.currentMenuTab === modelData.id
onClicked: Config.currentMenuTab = modelData.id
2021-04-23 11:43:18 +00:00
visible: modelData.ifEnabled !== "browser" || appSettings.isBrowserEnabled
}
}
Item {
id: invisibleSeparator
height: 16
width: parent.width
}
Repeater {
model: ProfileConstants.extraMenuButtons
delegate: StatusNavigationListItem {
itemId: modelData.id
title: modelData.text
icon.name: modelData.icon
selected: Config.currentMenuTab === modelData.id
visible: modelData.ifEnabled !== "browser" || appSettings.isBrowserEnabled
onClicked: function () {
2021-03-16 14:54:34 +00:00
if (modelData.function === "exit") {
return Qt.quit()
}
Config.currentMenuTab = modelData.id
2020-06-17 20:33:44 +00:00
}
2020-05-27 20:57:36 +00:00
}
}
}
2020-05-27 21:28:25 +00:00
}