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

318 lines
10 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
2020-05-27 20:57:36 +00:00
import "../../../../imports"
import "../../../../shared"
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
Rectangle {
2020-05-27 20:57:36 +00:00
property alias profileCurrentIndex: profileScreenButtons.currentIndex
readonly property int btnheight: 42
2020-06-25 16:58:21 +00:00
readonly property int w: 340
2020-05-27 20:57:36 +00:00
id: profileTabBar
color: Style.current.transparent
2020-05-27 21:28:25 +00:00
height: parent.height
2020-05-27 20:57:36 +00:00
Layout.fillHeight: true
Layout.fillWidth: true
2020-05-27 21:28:25 +00:00
TabBar {
id: profileScreenButtons
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
2020-05-27 20:57:36 +00:00
height: parent.height
2020-05-27 21:28:25 +00:00
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
currentIndex: 0
spacing: 0
background: Rectangle {
color: "#00000000"
}
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
TabButton {
id: ensTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
2020-06-17 21:12:36 +00:00
height: 0 //profileTabBar.btnheight
visible: false
2020-05-27 21:28:25 +00:00
text: ""
anchors.top: parent.top
anchors.topMargin: 0
2020-05-27 20:57:36 +00:00
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element1
//% "ENS usernames"
text: qsTrId("ens-usernames")
2020-05-27 21:28:25 +00:00
anchors.left: parent.left
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 0 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
}
}
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
TabButton {
id: contactsTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
2020-05-27 21:28:25 +00:00
height: profileTabBar.btnheight
text: ""
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: ensTabButton.bottom
anchors.topMargin: 0
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element2
//% "Contacts"
text: qsTrId("contacts")
2020-05-27 20:57:36 +00:00
anchors.left: parent.left
2020-05-27 21:28:25 +00:00
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 1 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
}
}
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
TabButton {
id: privacyTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
height: profileTabBar.btnheight
2020-05-27 21:28:25 +00:00
text: ""
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: contactsTabButton.bottom
anchors.topMargin: 0
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element3
//% "Privacy and security"
text: qsTrId("privacy-and-security")
2020-05-27 20:57:36 +00:00
anchors.left: parent.left
2020-05-27 21:28:25 +00:00
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 2 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
}
}
2020-05-27 20:57:36 +00:00
2020-07-03 16:54:27 +00:00
TabButton {
id: devicesTabButton
width: profileTabBar.w
height: profileTabBar.btnheight
visible: true
text: ""
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: privacyTabButton.bottom
anchors.topMargin: 0
background: Rectangle {
color: Style.current.transparent
2020-07-03 16:54:27 +00:00
}
StyledText {
//% "Devices"
text: qsTrId("devices")
2020-07-03 16:54:27 +00:00
anchors.left: parent.left
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
font.weight: profileScreenButtons.currentIndex === 3 ? Font.Bold : Font.Medium
font.pixelSize: 14
}
}
2020-05-27 21:28:25 +00:00
TabButton {
id: syncTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
2020-06-17 21:12:36 +00:00
height: 0 //profileTabBar.btnheight
visible: false
2020-05-27 21:28:25 +00:00
text: ""
anchors.left: parent.left
anchors.leftMargin: 0
2020-07-03 16:54:27 +00:00
anchors.top: devicesTabButton.bottom
2020-05-27 21:28:25 +00:00
anchors.topMargin: 0
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element4
//% "Sync settings"
text: qsTrId("sync-settings")
2020-05-27 20:57:36 +00:00
anchors.left: parent.left
2020-05-27 21:28:25 +00:00
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 3 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
}
}
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
TabButton {
id: languageTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
2020-06-17 21:12:36 +00:00
height: 0 //profileTabBar.btnheight
visible: false
2020-05-27 21:28:25 +00:00
text: ""
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: syncTabButton.bottom
anchors.topMargin: 0
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element5
//% "Language settings"
text: qsTrId("language-settings")
2020-05-27 20:57:36 +00:00
anchors.left: parent.left
2020-05-27 21:28:25 +00:00
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 4 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
}
}
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
TabButton {
id: notificationsTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
2020-06-17 21:12:36 +00:00
height: 0 //profileTabBar.btnheight
visible: false
2020-05-27 21:28:25 +00:00
text: ""
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: languageTabButton.bottom
anchors.topMargin: 0
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element6
//% "Notifications settings"
text: qsTrId("notifications-settings")
2020-05-27 20:57:36 +00:00
anchors.left: parent.left
2020-05-27 21:28:25 +00:00
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 5 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
}
}
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
TabButton {
id: advancedTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
height: profileTabBar.btnheight
2020-05-27 21:28:25 +00:00
text: ""
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: notificationsTabButton.bottom
anchors.topMargin: 0
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element7
//% "Advanced settings"
text: qsTrId("advanced-settings")
2020-05-27 20:57:36 +00:00
anchors.left: parent.left
2020-05-27 21:28:25 +00:00
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 6 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
}
}
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
TabButton {
id: helpTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
2020-06-17 21:05:59 +00:00
height: 0 //profileTabBar.btnheight
2020-05-27 21:28:25 +00:00
text: ""
2020-06-17 21:05:59 +00:00
visible: false
2020-05-27 21:28:25 +00:00
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: advancedTabButton.bottom
anchors.topMargin: 0
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element8
//% "Need help?"
text: qsTrId("need-help")
2020-05-27 20:57:36 +00:00
anchors.left: parent.left
2020-05-27 21:28:25 +00:00
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 7 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
}
}
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
TabButton {
id: aboutTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
2020-05-27 21:28:25 +00:00
height: profileTabBar.btnheight
text: ""
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: helpTabButton.bottom
anchors.topMargin: 0
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element9
//% "About"
text: qsTrId("about-app")
2020-05-27 20:57:36 +00:00
anchors.left: parent.left
2020-05-27 21:28:25 +00:00
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 8 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
}
}
2020-05-27 20:57:36 +00:00
2020-05-27 21:28:25 +00:00
TabButton {
id: signoutTabButton
2020-06-25 16:58:21 +00:00
width: profileTabBar.w
2020-05-27 21:28:25 +00:00
height: profileTabBar.btnheight
text: ""
anchors.left: parent.left
anchors.leftMargin: 0
2020-06-17 21:12:36 +00:00
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
2020-05-27 21:28:25 +00:00
background: Rectangle {
color: Style.current.transparent
2020-05-27 20:57:36 +00:00
}
StyledText {
2020-05-27 21:28:25 +00:00
id: element10
//% "Sign out"
text: qsTrId("sign-out")
2020-05-27 20:57:36 +00:00
anchors.left: parent.left
2020-05-27 21:28:25 +00:00
anchors.leftMargin: 72
anchors.verticalCenter: parent.verticalCenter
2020-06-17 20:33:44 +00:00
font.weight: profileScreenButtons.currentIndex === 9 ? Font.Bold : Font.Medium
2020-05-27 21:28:25 +00:00
font.pixelSize: 14
2020-06-17 20:33:44 +00:00
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
// profileModel.logout();
Qt.quit();
}
}
2020-05-27 20:57:36 +00:00
}
}
}
2020-05-27 21:28:25 +00:00
}