2023-02-21 16:11:44 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtGraphicalEffects 1.15
|
2022-07-13 12:29:38 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
2021-12-21 20:52:17 +00:00
|
|
|
import shared.popups 1.0
|
2022-07-26 14:23:45 +00:00
|
|
|
import shared.views.chat 1.0
|
|
|
|
|
2022-07-13 12:29:38 +00:00
|
|
|
import utils 1.0
|
2021-10-18 10:56:05 +00:00
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
import "../views"
|
|
|
|
import "../panels"
|
2022-10-26 16:00:20 +00:00
|
|
|
import "../stores"
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2021-05-28 17:35:21 +00:00
|
|
|
Popup {
|
2022-07-26 14:23:45 +00:00
|
|
|
id: root
|
|
|
|
|
2022-10-26 16:00:20 +00:00
|
|
|
property ActivityCenterStore activityCenterStore
|
2021-10-01 15:58:36 +00:00
|
|
|
property var store
|
2021-06-10 15:15:38 +00:00
|
|
|
|
2022-09-15 16:34:41 +00:00
|
|
|
onOpened: {
|
|
|
|
Global.popupOpened = true
|
|
|
|
}
|
|
|
|
onClosed: {
|
|
|
|
Global.popupOpened = false
|
2023-02-07 15:53:56 +00:00
|
|
|
activityCenterStore.markAsSeenActivityCenterNotifications()
|
2022-09-15 16:34:41 +00:00
|
|
|
}
|
2022-05-19 12:33:17 +00:00
|
|
|
|
2022-09-19 13:16:48 +00:00
|
|
|
x: Global.applicationWindow.width - root.width - Style.current.halfPadding
|
|
|
|
width: 560
|
|
|
|
padding: 0
|
2021-07-29 19:20:49 +00:00
|
|
|
modal: false
|
2021-05-28 17:35:21 +00:00
|
|
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
|
|
|
parent: Overlay.overlay
|
2021-07-29 19:20:49 +00:00
|
|
|
|
2022-11-29 11:57:07 +00:00
|
|
|
Overlay.modeless: null
|
2021-09-08 02:11:51 +00:00
|
|
|
|
2021-05-28 17:35:21 +00:00
|
|
|
background: Rectangle {
|
|
|
|
color: Style.current.background
|
|
|
|
radius: Style.current.radius
|
2021-07-29 19:20:49 +00:00
|
|
|
layer.enabled: true
|
|
|
|
layer.effect: DropShadow {
|
|
|
|
verticalOffset: 3
|
|
|
|
radius: Style.current.radius
|
|
|
|
samples: 15
|
|
|
|
fast: true
|
|
|
|
cached: true
|
|
|
|
color: Style.current.dropShadow
|
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
2022-09-19 13:16:48 +00:00
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
ActivityCenterPopupTopBarPanel {
|
2021-05-28 17:35:21 +00:00
|
|
|
id: activityCenterTopBar
|
2022-09-12 10:06:26 +00:00
|
|
|
width: parent.width
|
2023-02-22 15:49:44 +00:00
|
|
|
unreadNotificationsCount: activityCenterStore.unreadNotificationsCount
|
2023-02-23 12:43:28 +00:00
|
|
|
hasAdmin: activityCenterStore.adminCount > 0
|
|
|
|
hasReplies: activityCenterStore.repliesCount > 0
|
|
|
|
hasMentions: activityCenterStore.mentionsCount > 0
|
|
|
|
hasContactRequests: activityCenterStore.contactRequestsCount > 0
|
|
|
|
hasIdentityRequests: activityCenterStore.identityRequestsCount > 0
|
|
|
|
hasMembership: activityCenterStore.membershipCount > 0
|
2023-02-23 11:09:05 +00:00
|
|
|
hideReadNotifications: activityCenterStore.activityCenterReadType === ActivityCenterStore.ActivityCenterReadType.Unread
|
2023-02-21 16:11:44 +00:00
|
|
|
activeGroup: activityCenterStore.activeNotificationGroup
|
|
|
|
onGroupTriggered: activityCenterStore.setActiveNotificationGroup(group)
|
2023-02-23 12:43:28 +00:00
|
|
|
onMarkAllReadClicked: activityCenterStore.markAllActivityCenterNotificationsRead()
|
2023-02-22 15:49:44 +00:00
|
|
|
onShowHideReadNotifications: activityCenterStore.setActivityCenterReadType(hideReadNotifications ?
|
2023-02-23 11:09:05 +00:00
|
|
|
ActivityCenterStore.ActivityCenterReadType.Unread :
|
|
|
|
ActivityCenterStore.ActivityCenterReadType.All)
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
|
2022-09-15 16:34:41 +00:00
|
|
|
StatusListView {
|
|
|
|
id: listView
|
2022-09-12 10:06:26 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2021-05-28 17:35:21 +00:00
|
|
|
anchors.top: activityCenterTopBar.bottom
|
2021-06-11 17:41:59 +00:00
|
|
|
anchors.bottom: parent.bottom
|
2022-09-15 16:34:41 +00:00
|
|
|
anchors.margins: Style.current.smallPadding
|
2023-01-23 09:00:06 +00:00
|
|
|
spacing: 1
|
2021-05-28 17:35:21 +00:00
|
|
|
|
2023-02-13 08:51:24 +00:00
|
|
|
model: root.activityCenterStore.activityCenterNotifications
|
2021-06-11 17:41:59 +00:00
|
|
|
|
2022-11-30 11:15:29 +00:00
|
|
|
delegate: Loader {
|
|
|
|
width: listView.availableWidth
|
|
|
|
|
|
|
|
property int filteredIndex: index
|
|
|
|
property var notification: model
|
|
|
|
|
|
|
|
sourceComponent: {
|
|
|
|
switch (model.notificationType) {
|
2023-02-23 11:09:05 +00:00
|
|
|
case ActivityCenterStore.ActivityCenterNotificationType.Mention:
|
2022-11-30 11:15:29 +00:00
|
|
|
return mentionNotificationComponent
|
2023-02-23 11:09:05 +00:00
|
|
|
case ActivityCenterStore.ActivityCenterNotificationType.Reply:
|
2022-11-30 11:15:29 +00:00
|
|
|
return replyNotificationComponent
|
2023-02-23 11:09:05 +00:00
|
|
|
case ActivityCenterStore.ActivityCenterNotificationType.ContactRequest:
|
2022-11-30 11:15:29 +00:00
|
|
|
return contactRequestNotificationComponent
|
2023-02-23 11:09:05 +00:00
|
|
|
case ActivityCenterStore.ActivityCenterNotificationType.ContactVerification:
|
2022-11-15 10:11:55 +00:00
|
|
|
return verificationRequestNotificationComponent
|
2023-02-23 11:09:05 +00:00
|
|
|
case ActivityCenterStore.ActivityCenterNotificationType.CommunityInvitation:
|
2022-11-30 11:15:29 +00:00
|
|
|
return communityInvitationNotificationComponent
|
2023-02-23 11:09:05 +00:00
|
|
|
case ActivityCenterStore.ActivityCenterNotificationType.MembershipRequest:
|
2022-11-30 11:15:29 +00:00
|
|
|
return membershipRequestNotificationComponent
|
2023-02-23 11:09:05 +00:00
|
|
|
case ActivityCenterStore.ActivityCenterNotificationType.CommunityRequest:
|
2022-11-30 11:15:29 +00:00
|
|
|
return communityRequestNotificationComponent
|
2023-02-23 11:09:05 +00:00
|
|
|
case ActivityCenterStore.ActivityCenterNotificationType.CommunityKicked:
|
2022-11-30 11:15:29 +00:00
|
|
|
return communityKickedNotificationComponent
|
|
|
|
default:
|
|
|
|
return null
|
2022-10-18 19:46:57 +00:00
|
|
|
}
|
|
|
|
}
|
2021-06-11 17:41:59 +00:00
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
2022-11-30 11:15:29 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: mentionNotificationComponent
|
|
|
|
|
|
|
|
ActivityNotificationMention {
|
|
|
|
filteredIndex: parent.filteredIndex
|
|
|
|
notification: parent.notification
|
|
|
|
store: root.store
|
|
|
|
activityCenterStore: root.activityCenterStore
|
|
|
|
onCloseActivityCenter: root.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: replyNotificationComponent
|
|
|
|
|
|
|
|
ActivityNotificationReply {
|
|
|
|
filteredIndex: parent.filteredIndex
|
|
|
|
notification: parent.notification
|
|
|
|
store: root.store
|
|
|
|
activityCenterStore: root.activityCenterStore
|
|
|
|
onCloseActivityCenter: root.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: contactRequestNotificationComponent
|
|
|
|
|
|
|
|
ActivityNotificationContactRequest {
|
|
|
|
filteredIndex: parent.filteredIndex
|
|
|
|
notification: parent.notification
|
|
|
|
store: root.store
|
|
|
|
activityCenterStore: root.activityCenterStore
|
|
|
|
onCloseActivityCenter: root.close()
|
|
|
|
}
|
|
|
|
}
|
2022-11-15 10:11:55 +00:00
|
|
|
Component {
|
|
|
|
id: verificationRequestNotificationComponent
|
|
|
|
|
|
|
|
ActivityNotificationContactVerification {
|
|
|
|
filteredIndex: parent.filteredIndex
|
|
|
|
notification: parent.notification
|
|
|
|
store: root.store
|
|
|
|
activityCenterStore: root.activityCenterStore
|
|
|
|
onCloseActivityCenter: root.close()
|
|
|
|
}
|
|
|
|
}
|
2022-11-30 11:15:29 +00:00
|
|
|
Component {
|
|
|
|
id: communityInvitationNotificationComponent
|
|
|
|
|
|
|
|
ActivityNotificationCommunityInvitation {
|
|
|
|
filteredIndex: parent.filteredIndex
|
|
|
|
notification: parent.notification
|
|
|
|
store: root.store
|
|
|
|
activityCenterStore: root.activityCenterStore
|
|
|
|
onCloseActivityCenter: root.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: membershipRequestNotificationComponent
|
|
|
|
|
|
|
|
ActivityNotificationCommunityMembershipRequest {
|
|
|
|
filteredIndex: parent.filteredIndex
|
|
|
|
notification: parent.notification
|
|
|
|
store: root.store
|
|
|
|
activityCenterStore: root.activityCenterStore
|
|
|
|
onCloseActivityCenter: root.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: communityRequestNotificationComponent
|
|
|
|
|
|
|
|
ActivityNotificationCommunityRequest {
|
|
|
|
filteredIndex: parent.filteredIndex
|
|
|
|
notification: parent.notification
|
|
|
|
store: root.store
|
|
|
|
activityCenterStore: root.activityCenterStore
|
|
|
|
onCloseActivityCenter: root.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: communityKickedNotificationComponent
|
|
|
|
|
|
|
|
ActivityNotificationCommunityKicked {
|
|
|
|
filteredIndex: parent.filteredIndex
|
|
|
|
notification: parent.notification
|
|
|
|
store: root.store
|
|
|
|
activityCenterStore: root.activityCenterStore
|
|
|
|
onCloseActivityCenter: root.close()
|
|
|
|
}
|
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|