mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
parent
2d02a3cb2e
commit
91d80541be
@ -86,7 +86,7 @@ QtObject:
|
|||||||
if (receivedData.activityCenterNotifications.len > 0):
|
if (receivedData.activityCenterNotifications.len > 0):
|
||||||
self.events.emit(
|
self.events.emit(
|
||||||
SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_LOADED,
|
SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_LOADED,
|
||||||
ActivityCenterNotificationsArgs(activityCenterNotifications: receivedData.activityCenterNotifications.filter(n => n.notificationType != ActivityCenterNotificationType.ContactRequest))
|
ActivityCenterNotificationsArgs(activityCenterNotifications: receivedData.activityCenterNotifications)
|
||||||
)
|
)
|
||||||
|
|
||||||
proc hasMoreToShow*(self: Service): bool =
|
proc hasMoreToShow*(self: Service): bool =
|
||||||
|
@ -62,6 +62,19 @@ Popup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function calcNotificationType(notificationType, cnt) {
|
||||||
|
switch (notificationType) {
|
||||||
|
case Constants.activityCenterNotificationTypeMention:
|
||||||
|
root.mentionsCount += cnt
|
||||||
|
case Constants.activityCenterNotificationTypeReply:
|
||||||
|
root.repliesCount += cnt
|
||||||
|
case Constants.activityCenterNotificationTypeContactRequest:
|
||||||
|
root.contactRequestsCount += cnt
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onOpened: {
|
onOpened: {
|
||||||
Global.popupOpened = true
|
Global.popupOpened = true
|
||||||
}
|
}
|
||||||
@ -69,17 +82,18 @@ Popup {
|
|||||||
Global.popupOpened = false
|
Global.popupOpened = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x: Global.applicationWindow.width - root.width - Style.current.halfPadding
|
||||||
|
width: 560
|
||||||
|
padding: 0
|
||||||
|
dim: true
|
||||||
modal: false
|
modal: false
|
||||||
|
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
parent: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
|
|
||||||
dim: true
|
|
||||||
Overlay.modeless: MouseArea {
|
Overlay.modeless: MouseArea {
|
||||||
onClicked: activityCenter.close()
|
onClicked: activityCenter.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
width: 560
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: Style.current.background
|
color: Style.current.background
|
||||||
radius: Style.current.radius
|
radius: Style.current.radius
|
||||||
@ -93,8 +107,16 @@ Popup {
|
|||||||
color: Style.current.dropShadow
|
color: Style.current.dropShadow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x: Global.applicationWindow.width - root.width - Style.current.halfPadding
|
|
||||||
padding: 0
|
Repeater {
|
||||||
|
id: notificationTypeCounter
|
||||||
|
model: root.store.activityCenterList
|
||||||
|
|
||||||
|
delegate: Item {
|
||||||
|
Component.onCompleted: calcNotificationType(model.notificationType, 1)
|
||||||
|
Component.onDestruction: calcNotificationType(model.notificationType, -1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ActivityCenterPopupTopBarPanel {
|
ActivityCenterPopupTopBarPanel {
|
||||||
id: activityCenterTopBar
|
id: activityCenterTopBar
|
||||||
@ -121,7 +143,8 @@ Popup {
|
|||||||
model: SortFilterProxyModel {
|
model: SortFilterProxyModel {
|
||||||
sourceModel: root.store.activityCenterList
|
sourceModel: root.store.activityCenterList
|
||||||
|
|
||||||
filters: ExpressionFilter { expression: filterActivityCategories(model.notificationType) && !(root.hideReadNotifications && model.read) }
|
filters: ExpressionFilter { expression: filterActivityCategories(model.notificationType) &&
|
||||||
|
!(root.hideReadNotifications && model.read) }
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: DelegateChooser {
|
delegate: DelegateChooser {
|
||||||
@ -133,8 +156,7 @@ Popup {
|
|||||||
ActivityNotificationMention {
|
ActivityNotificationMention {
|
||||||
store: root.store
|
store: root.store
|
||||||
notification: model
|
notification: model
|
||||||
Component.onCompleted: root.mentionsCount++
|
messageContextMenu: root.messageContextMenu
|
||||||
Component.onDestruction: root.mentionsCount--
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
@ -143,8 +165,7 @@ Popup {
|
|||||||
ActivityNotificationReply {
|
ActivityNotificationReply {
|
||||||
store: root.store
|
store: root.store
|
||||||
notification: model
|
notification: model
|
||||||
Component.onCompleted: root.repliesCount++
|
messageContextMenu: root.messageContextMenu
|
||||||
Component.onDestruction: root.repliesCount--
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
@ -153,68 +174,9 @@ Popup {
|
|||||||
ActivityNotificationContactRequest {
|
ActivityNotificationContactRequest {
|
||||||
store: root.store
|
store: root.store
|
||||||
notification: model
|
notification: model
|
||||||
Component.onCompleted: root.contactRequestsCount++
|
messageContextMenu: root.messageContextMenu
|
||||||
Component.onDestruction: root.contactRequestsCount--
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// id: notifLoader
|
|
||||||
// anchors.top: parent.top
|
|
||||||
// active: !!sourceComponent
|
|
||||||
// width: parent.width
|
|
||||||
// sourceComponent: {
|
|
||||||
// switch (model.notificationType) {
|
|
||||||
// case Constants.activityCenterNotificationTypeOneToOne:
|
|
||||||
// case Constants.activityCenterNotificationTypeMention:
|
|
||||||
// case Constants.activityCenterNotificationTypeReply: return messageNotificationComponent
|
|
||||||
// case Constants.activityCenterNotificationTypeGroupRequest: return groupRequestNotificationComponent
|
|
||||||
// default: return null
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// onLoaded: {
|
|
||||||
// if (model.notificationType === Constants.activityCenterNotificationTypeReply ||
|
|
||||||
// model.notificationType === Constants.activityCenterNotificationTypeGroupRequest) {
|
|
||||||
// item.previousNotificationIndex = Qt.binding(() => notifLoader.previousNotificationIndex);
|
|
||||||
// item.previousNotificationTimestamp = Qt.binding(() => notifLoader.previousNotificationTimestamp);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Component {
|
|
||||||
// id: messageNotificationComponent
|
|
||||||
|
|
||||||
// ActivityCenterMessageComponentView {
|
|
||||||
// id: activityCenterMessageView
|
|
||||||
// store: root.store
|
|
||||||
// acCurrentActivityCategory: root.currentActivityCategory
|
|
||||||
// chatSectionModule: root.chatSectionModule
|
|
||||||
// messageContextMenu: root.messageContextMenu
|
|
||||||
// hideReadNotifications: root.hideReadNotifications
|
|
||||||
// Connections {
|
|
||||||
// target: root
|
|
||||||
// onOpened: activityCenterMessageView.reevaluateItemBadge()
|
|
||||||
// }
|
|
||||||
// onActivityCenterClose: {
|
|
||||||
// root.close();
|
|
||||||
// }
|
|
||||||
// Component.onCompleted: {
|
|
||||||
// activityCenterMessageView.reevaluateItemBadge()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Component {
|
|
||||||
// id: groupRequestNotificationComponent
|
|
||||||
|
|
||||||
// ActivityCenterGroupRequest {
|
|
||||||
// store: root.store
|
|
||||||
// hideReadNotifications: root.hideReadNotifications
|
|
||||||
// acCurrentActivityCategoryAll: root.currentActivityCategory === ActivityCenter.ActivityCategory.All
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@ import shared.views.chat 1.0
|
|||||||
ActivityNotificationBase {
|
ActivityNotificationBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property var messageContextMenu
|
||||||
|
|
||||||
signal activityCenterClose()
|
signal activityCenterClose()
|
||||||
|
|
||||||
height: Math.max(60, notificationMessage.height)
|
height: Math.max(60, notificationMessage.height)
|
||||||
@ -22,14 +24,17 @@ ActivityNotificationBase {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
z: -1
|
z: -1
|
||||||
|
|
||||||
rootStore: root.store
|
rootStore: root.store
|
||||||
messageStore: root.store.messageStore
|
messageStore: root.store.messageStore
|
||||||
|
messageContextMenu: root.messageContextMenu
|
||||||
|
|
||||||
messageId: notification.id
|
messageId: notification.id
|
||||||
senderDisplayName: notification.message.senderDisplayName
|
senderDisplayName: notification.message.senderDisplayName
|
||||||
messageText: notification.message.messageText
|
messageText: notification.message.messageText
|
||||||
responseToMessageWithId: notification.message.responseToMessageWithId
|
responseToMessageWithId: notification.message.responseToMessageWithId
|
||||||
senderId: notification.message.senderId
|
senderId: notification.message.senderId
|
||||||
senderLocalName: notification.message.senderLocalName
|
senderOptionalName: notification.message.senderOptionalName
|
||||||
senderIcon: notification.message.senderIcon
|
senderIcon: notification.message.senderIcon
|
||||||
amISender: notification.message.amISender
|
amISender: notification.message.amISender
|
||||||
messageImage: notification.message.messageImage
|
messageImage: notification.message.messageImage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user