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