2021-05-31 12:55:01 +00:00
|
|
|
import QtQuick 2.14
|
2022-02-01 09:22:06 +00:00
|
|
|
import QtQuick.Controls 2.14
|
2021-05-31 12:55:01 +00:00
|
|
|
|
2022-02-01 09:22:06 +00:00
|
|
|
import StatusQ.Core 0.1
|
2021-05-31 12:55:01 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
2022-02-01 09:22:06 +00:00
|
|
|
import StatusQ.Components 0.1
|
2021-05-31 12:55:01 +00:00
|
|
|
import StatusQ.Layout 0.1
|
2021-06-02 10:41:31 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2021-08-27 13:21:00 +00:00
|
|
|
import StatusQ.Platform 0.1
|
2021-05-31 12:55:01 +00:00
|
|
|
|
2022-01-18 19:54:45 +00:00
|
|
|
import "demoapp"
|
2022-02-01 15:20:57 +00:00
|
|
|
import "demoapp/data" 1.0
|
2022-01-18 19:54:45 +00:00
|
|
|
|
2022-11-28 11:32:29 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2021-05-31 12:55:01 +00:00
|
|
|
Rectangle {
|
|
|
|
id: demoApp
|
|
|
|
height: 602
|
2021-07-26 13:13:04 +00:00
|
|
|
width: 1002
|
2021-05-31 12:55:01 +00:00
|
|
|
border.width: 1
|
|
|
|
border.color: Theme.palette.baseColor2
|
|
|
|
|
2021-08-27 13:21:00 +00:00
|
|
|
property string titleStyle: "osx"
|
2021-05-31 12:55:01 +00:00
|
|
|
|
2022-02-01 09:11:40 +00:00
|
|
|
QtObject {
|
|
|
|
id: appSectionType
|
|
|
|
readonly property int chat: 0
|
|
|
|
readonly property int community: 1
|
2022-05-31 09:44:26 +00:00
|
|
|
readonly property int communitiesPortal: 2
|
|
|
|
readonly property int wallet: 3
|
2022-02-01 09:11:40 +00:00
|
|
|
readonly property int browser: 3
|
2022-05-31 09:44:26 +00:00
|
|
|
readonly property int nodeManagement: 5
|
|
|
|
readonly property int profileSettings: 6
|
2022-02-01 09:11:40 +00:00
|
|
|
readonly property int apiDocumentation: 100
|
|
|
|
readonly property int demoApp: 101
|
|
|
|
}
|
|
|
|
|
|
|
|
function setActiveItem(sectionId) {
|
2022-02-01 15:20:57 +00:00
|
|
|
for (var i = 0; i < Models.demoAppSectionsModel.count; i++) {
|
|
|
|
let item = Models.demoAppSectionsModel.get(i)
|
2022-02-01 09:11:40 +00:00
|
|
|
if (item.sectionId !== sectionId)
|
|
|
|
{
|
2022-02-01 15:20:57 +00:00
|
|
|
Models.demoAppSectionsModel.setProperty(i, "active", false)
|
2022-02-01 09:11:40 +00:00
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
2022-02-01 15:20:57 +00:00
|
|
|
Models.demoAppSectionsModel.setProperty(i, "active", true);
|
2022-02-01 09:11:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-27 13:21:00 +00:00
|
|
|
StatusMacTrafficLights {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.margins: 13
|
2021-05-31 12:55:01 +00:00
|
|
|
z: statusAppLayout.z + 1
|
2021-08-27 13:21:00 +00:00
|
|
|
visible: titleStyle === "osx"
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
|
2021-08-27 13:21:00 +00:00
|
|
|
StatusWindowsTitleBar {
|
|
|
|
id: windowsTitle
|
|
|
|
anchors.top: parent.top
|
|
|
|
width: parent.width
|
|
|
|
z: statusAppLayout.z + 1
|
|
|
|
visible: titleStyle === "windows"
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
|
2022-09-02 07:25:43 +00:00
|
|
|
StatusMainLayout {
|
2021-05-31 12:55:01 +00:00
|
|
|
id: statusAppLayout
|
2021-08-27 13:21:00 +00:00
|
|
|
anchors.top: windowsTitle.visible ? windowsTitle.bottom : demoApp.top
|
2021-05-31 12:55:01 +00:00
|
|
|
anchors.left: demoApp.left
|
|
|
|
anchors.topMargin: demoApp.border.width
|
|
|
|
anchors.leftMargin: demoApp.border.width
|
|
|
|
|
|
|
|
height: demoApp.height - demoApp.border.width * 2
|
|
|
|
width: demoApp.width - demoApp.border.width * 2
|
|
|
|
|
2022-09-02 07:25:43 +00:00
|
|
|
leftPanel: StatusAppNavBar {
|
2021-06-11 11:08:12 +00:00
|
|
|
id: navBar
|
|
|
|
|
2022-11-28 11:32:29 +00:00
|
|
|
chatItemsModel: SortFilterProxyModel {
|
|
|
|
sourceModel: Models.demoAppSectionsModel
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "sectionType"
|
|
|
|
value: appSectionType.chat
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
|
2022-11-28 11:32:29 +00:00
|
|
|
chatItemDelegate: navButtonComponent
|
2022-02-01 09:11:40 +00:00
|
|
|
|
2022-11-28 11:32:29 +00:00
|
|
|
communityItemsModel: SortFilterProxyModel {
|
|
|
|
sourceModel: Models.demoAppSectionsModel
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "sectionType"
|
|
|
|
value: appSectionType.community
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-28 11:32:29 +00:00
|
|
|
communityItemDelegate: StatusNavBarTabButton {
|
2021-05-31 12:55:01 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-02-01 09:11:40 +00:00
|
|
|
name: model.icon.length > 0? "" : model.name
|
|
|
|
icon.name: model.icon
|
|
|
|
icon.source: model.image
|
|
|
|
tooltip.text: model.name
|
|
|
|
autoExclusive: true
|
|
|
|
checked: model.active
|
|
|
|
badge.value: model.notificationsCount
|
|
|
|
badge.visible: model.hasNotification
|
|
|
|
badge.border.color: hovered ? Theme.palette.statusBadge.hoverBorderColor : Theme.palette.statusBadge.borderColor
|
|
|
|
badge.border.width: 2
|
2021-05-31 12:55:01 +00:00
|
|
|
onClicked: {
|
2022-02-01 09:11:40 +00:00
|
|
|
if(model.sectionType === appSectionType.community)
|
|
|
|
{
|
|
|
|
appView.sourceComponent = statusAppCommunityView
|
|
|
|
demoApp.setActiveItem(model.sectionId)
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
2021-06-11 11:08:12 +00:00
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
popupMenu: StatusMenu {
|
2021-06-11 11:08:12 +00:00
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2021-06-11 11:08:12 +00:00
|
|
|
text: qsTr("Invite People")
|
|
|
|
icon.name: "share-ios"
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2021-06-11 11:08:12 +00:00
|
|
|
text: qsTr("View Community")
|
|
|
|
icon.name: "group"
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2021-06-11 11:08:12 +00:00
|
|
|
text: qsTr("Edit Community")
|
|
|
|
icon.name: "edit"
|
2021-06-11 11:20:26 +00:00
|
|
|
enabled: false
|
2021-06-11 11:08:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2021-06-11 11:08:12 +00:00
|
|
|
text: qsTr("Leave Community")
|
2022-08-02 10:40:18 +00:00
|
|
|
icon.name: "arrow-left"
|
2022-12-01 16:58:37 +00:00
|
|
|
type: StatusAction.Type.Danger
|
2021-06-11 11:08:12 +00:00
|
|
|
}
|
|
|
|
}
|
2022-11-28 11:32:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
regularItemsModel: SortFilterProxyModel {
|
|
|
|
sourceModel: Models.demoAppSectionsModel
|
|
|
|
filters: RangeFilter {
|
|
|
|
roleName: "sectionType"
|
|
|
|
minimumValue: appSectionType.communitiesPortal
|
|
|
|
maximumValue: appSectionType.demoApp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
regularItemDelegate: navButtonComponent
|
|
|
|
|
|
|
|
delegateHeight: 40
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: navButtonComponent
|
|
|
|
StatusNavBarTabButton {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
name: model.icon.length > 0? "" : model.name
|
|
|
|
icon.name: model.icon
|
|
|
|
icon.source: model.image
|
|
|
|
tooltip.text: model.name
|
|
|
|
autoExclusive: true
|
|
|
|
checked: model.active
|
|
|
|
badge.value: model.notificationsCount
|
|
|
|
badge.visible: model.hasNotification
|
|
|
|
badge.border.color: hovered ? Theme.palette.statusBadge.hoverBorderColor : Theme.palette.statusBadge.borderColor
|
|
|
|
badge.border.width: 2
|
|
|
|
onClicked: {
|
|
|
|
if(model.sectionType === appSectionType.chat)
|
|
|
|
{
|
|
|
|
appView.sourceComponent = statusAppChatView
|
|
|
|
demoApp.setActiveItem(model.sectionId)
|
|
|
|
}
|
|
|
|
else if(model.sectionType === appSectionType.communitiesPortal)
|
|
|
|
{
|
|
|
|
appView.sourceComponent = statusCommunityPortalView
|
|
|
|
demoApp.setActiveItem(model.sectionId)
|
|
|
|
}
|
|
|
|
else if(model.sectionType === appSectionType.profileSettings)
|
|
|
|
{
|
|
|
|
appView.sourceComponent = statusAppProfileSettingsView
|
|
|
|
demoApp.setActiveItem(model.sectionId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-02 07:25:43 +00:00
|
|
|
rightPanel: Loader {
|
2021-05-31 12:55:01 +00:00
|
|
|
id: appView
|
|
|
|
anchors.fill: parent
|
|
|
|
sourceComponent: statusAppChatView
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: statusAppChatView
|
2022-02-01 15:20:57 +00:00
|
|
|
StatusAppChatView { }
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: statusAppCommunityView
|
2022-02-01 15:20:57 +00:00
|
|
|
StatusAppCommunityView {
|
|
|
|
communityDetailModalTitle: demoCommunityDetailModal.header.title
|
2022-09-02 15:40:30 +00:00
|
|
|
communityDetailModalImage: demoCommunityDetailModal.header.asset.name
|
2022-02-01 15:20:57 +00:00
|
|
|
onChatInfoButtonClicked: {
|
|
|
|
demoCommunityDetailModal.open();
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-06-07 09:16:18 +00:00
|
|
|
|
2021-06-17 13:10:55 +00:00
|
|
|
Component {
|
|
|
|
id: statusAppProfileSettingsView
|
2022-01-18 19:54:45 +00:00
|
|
|
StatusAppProfileSettingsView { }
|
2021-06-17 13:10:55 +00:00
|
|
|
}
|
|
|
|
|
2022-05-31 09:44:26 +00:00
|
|
|
Component {
|
|
|
|
id: statusCommunityPortalView
|
|
|
|
StatusAppCommunitiesPortalView { }
|
|
|
|
}
|
|
|
|
|
2022-01-18 19:54:45 +00:00
|
|
|
DemoContactRequestsModal {
|
2021-06-23 12:57:29 +00:00
|
|
|
id: demoContactRequestsModal
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
|
2022-01-18 19:54:45 +00:00
|
|
|
DemoCommunityDetailModal {
|
2021-06-14 12:10:36 +00:00
|
|
|
id: demoCommunityDetailModal
|
2021-06-17 13:10:55 +00:00
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|