Sale Djenic 496d3c8441 fix(@desktop/chat): click on "Notification settings" doesn't take the user to that section
Click on "Notification settings" in activity center takes user to profile tab, but not to the
notification section there, but to the last selected section. That is fixed now. Also marking
selected section within profile section is fixed now.

Fixes: #3049
2021-07-29 09:05:16 -04:00

85 lines
2.5 KiB
QML

import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import "../../../../imports"
import "../../../../shared"
import "./components"
import "./constants.js" as ProfileConstants
ScrollView {
readonly property int btnheight: 42
readonly property int w: 340
property var changeProfileSection: function (sectionId) {
Config.currentMenuTab = sectionId
}
contentHeight: menuItems.height + 24
id: profileMenu
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
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 {
menuItemId: modelData.id
text: modelData.text
source: "../../../img/profile/" + modelData.filename
active: Config.currentMenuTab === modelData.id
Layout.fillWidth: true
width: profileMenu.width
onClicked: function () {
if (modelData.function === "exit") {
return Qt.quit()
}
Config.currentMenuTab = modelData.id
}
}
}
}
}