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
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
StatusAppLayout {
|
|
|
|
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
|
|
|
|
|
|
|
|
appNavBar: StatusAppNavBar {
|
|
|
|
|
2021-06-11 11:08:12 +00:00
|
|
|
id: navBar
|
|
|
|
|
2022-02-01 09:11:40 +00:00
|
|
|
communityTypeRole: "sectionType"
|
|
|
|
communityTypeValue: appSectionType.community
|
2022-02-01 15:20:57 +00:00
|
|
|
sectionModel: Models.demoAppSectionsModel
|
2022-02-01 09:11:40 +00:00
|
|
|
|
|
|
|
property bool communityAdded: false
|
|
|
|
|
|
|
|
onAboutToUpdateFilteredRegularModel: {
|
|
|
|
communityAdded = false
|
|
|
|
}
|
|
|
|
|
|
|
|
filterRegularItem: function(item) {
|
|
|
|
if(item.sectionType === appSectionType.community)
|
|
|
|
if(communityAdded)
|
|
|
|
return false
|
|
|
|
else
|
|
|
|
communityAdded = true
|
|
|
|
|
|
|
|
return true
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
|
2022-02-01 09:11:40 +00:00
|
|
|
filterCommunityItem: function(item) {
|
|
|
|
return item.sectionType === appSectionType.community
|
|
|
|
}
|
|
|
|
|
|
|
|
regularNavBarButton: 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)
|
|
|
|
}
|
2022-05-31 09:44:26 +00:00
|
|
|
else if(model.sectionType === appSectionType.communitiesPortal)
|
|
|
|
{
|
|
|
|
appView.sourceComponent = statusCommunityPortalView
|
|
|
|
demoApp.setActiveItem(model.sectionId)
|
|
|
|
}
|
2022-02-01 09:11:40 +00:00
|
|
|
else if(model.sectionType === appSectionType.profileSettings)
|
|
|
|
{
|
|
|
|
appView.sourceComponent = statusAppProfileSettingsView
|
|
|
|
demoApp.setActiveItem(model.sectionId)
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-01 09:11:40 +00:00
|
|
|
communityNavBarButton: 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
|
|
|
|
|
|
|
popupMenu: StatusPopupMenu {
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: qsTr("Invite People")
|
|
|
|
icon.name: "share-ios"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: qsTr("View Community")
|
|
|
|
icon.name: "group"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
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 {}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: qsTr("Leave Community")
|
|
|
|
icon.name: "arrow-right"
|
|
|
|
icon.width: 14
|
|
|
|
iconRotation: 180
|
|
|
|
type: StatusMenuItem.Type.Danger
|
|
|
|
}
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
appView: Loader {
|
|
|
|
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
|
|
|
|
communityDetailModalImage: demoCommunityDetailModal.header.image.source
|
|
|
|
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
|
|
|
}
|