85 lines
2.5 KiB
QML
Raw Normal View History

2020-06-17 15:18:31 -04:00
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
2020-05-27 16:57:36 -04:00
import "../../../../imports"
import "../../../../shared"
import "./components"
import "./constants.js" as ProfileConstants
2020-05-27 16:57:36 -04:00
ScrollView {
2020-05-27 16:57:36 -04:00
readonly property int btnheight: 42
2020-06-25 12:58:21 -04:00
readonly property int w: 340
property var changeProfileSection: function (sectionId) {
Config.currentMenuTab = sectionId
}
contentHeight: menuItems.height + 24
2020-05-27 16:57:36 -04:00
id: profileMenu
2021-03-25 14:12:33 -04:00
clip: true
Column {
id: menuItems
spacing: 8
Repeater {
model: ProfileConstants.mainMenuButtons
delegate: MenuButton {
menuItemId: modelData.id
text: modelData .text
source: "../../../img/profile/" + modelData.filename
active: Config.currentMenuTab === modelData.id
Layout.fillWidth: true
width: profileMenu.width
onClicked: {
Config.currentMenuTab = modelData.id
}
}
}
StyledText {
topPadding: 10
leftPadding: 20
text: "Settings"
color: Style.current.secondaryText
}
Repeater {
model: ProfileConstants.settingsMenuButtons
delegate: MenuButton {
menuItemId: modelData.id
text: modelData .text
source: "../../../img/profile/" + modelData.filename
active: Config.currentMenuTab === modelData.id
2021-04-23 07:43:18 -04:00
visible: modelData.ifEnabled !== "browser" || appSettings.isBrowserEnabled
Layout.fillWidth: true
width: profileMenu.width
onClicked: function () {
Config.currentMenuTab = modelData.id
}
}
}
StyledText {
text: " "
}
Repeater {
model: ProfileConstants.extraMenuButtons
delegate: MenuButton {
2020-10-26 16:20:31 -04:00
menuItemId: modelData.id
2021-03-16 10:54:34 -04:00
text: modelData.text
2020-08-28 15:09:00 -04:00
source: "../../../img/profile/" + modelData.filename
active: Config.currentMenuTab === modelData.id
Layout.fillWidth: true
width: profileMenu.width
onClicked: function () {
2021-03-16 10:54:34 -04:00
if (modelData.function === "exit") {
return Qt.quit()
}
Config.currentMenuTab = modelData.id
2020-06-17 16:33:44 -04:00
}
2020-05-27 16:57:36 -04:00
}
}
}
2020-05-27 17:28:25 -04:00
}