2021-10-06 09:16:39 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: root
|
|
|
|
spacing: 4
|
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
property var privacyStore
|
2021-10-06 09:16:39 +00:00
|
|
|
property alias mainMenuItems: mainMenuItems.model
|
|
|
|
property alias settingsMenuItems: settingsMenuItems.model
|
|
|
|
property alias extraMenuItems: extraMenuItems.model
|
2022-02-11 09:44:49 +00:00
|
|
|
property alias appsMenuItems: appsMenuItems.model
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
property bool browserMenuItemEnabled: false
|
2022-02-11 09:44:49 +00:00
|
|
|
property bool appsMenuItemsEnabled: false
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
signal menuItemClicked(var menu_item)
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: mainMenuItems
|
|
|
|
delegate: StatusNavigationListItem {
|
|
|
|
itemId: model.menu_id
|
|
|
|
title: model.text
|
|
|
|
icon.name: model.icon
|
2021-12-06 21:10:54 +00:00
|
|
|
selected: Global.currentMenuTab === model.menu_id
|
2021-10-06 09:16:39 +00:00
|
|
|
onClicked: root.menuItemClicked(model)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-11 09:44:49 +00:00
|
|
|
StatusListSectionHeadline {
|
|
|
|
text: qsTr("Apps")
|
|
|
|
visible: root.appsMenuItemsEnabled
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: appsMenuItems
|
|
|
|
delegate: StatusNavigationListItem {
|
|
|
|
id: appsMenuDelegate
|
|
|
|
itemId: model.menu_id
|
|
|
|
title: model.text
|
|
|
|
icon.name: model.icon
|
|
|
|
selected: Global.currentMenuTab === model.menu_id
|
|
|
|
onClicked: root.menuItemClicked(model)
|
|
|
|
visible: root.appsMenuItemsEnabled
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
StatusListSectionHeadline { text: qsTr("Settings") }
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: settingsMenuItems
|
|
|
|
delegate: StatusNavigationListItem {
|
|
|
|
id: settingsMenuDelegate
|
|
|
|
itemId: model.menu_id
|
|
|
|
title: model.text
|
|
|
|
icon.name: model.icon
|
2021-12-06 21:10:54 +00:00
|
|
|
selected: Global.currentMenuTab === model.menu_id
|
2021-10-06 09:16:39 +00:00
|
|
|
onClicked: root.menuItemClicked(model)
|
|
|
|
visible: model.ifEnabled !== "browser" || root.browserMenuItemEnabled
|
2021-12-30 12:39:47 +00:00
|
|
|
badge.value: !root.privacyStore.mnemonicBackedUp && settingsMenuDelegate.title === qsTr("Privacy and security")
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: invisibleSeparator
|
|
|
|
height: 16
|
|
|
|
width: parent.width
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: extraMenuItems
|
|
|
|
delegate: StatusNavigationListItem {
|
|
|
|
itemId: model.menu_id
|
|
|
|
title: model.text
|
|
|
|
icon.name: model.icon
|
2021-12-06 21:10:54 +00:00
|
|
|
selected: Global.currentMenuTab === model.menu_id
|
2021-10-06 09:16:39 +00:00
|
|
|
visible: model.ifEnabled !== "browser" || root.browserMenuItemEnabled
|
|
|
|
onClicked: root.menuItemClicked(model)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|