fix(CreateChatView): Move `ActivityCenterPopup` to appmain
Closes: #6345
This commit is contained in:
parent
2398b67bc1
commit
f1651ce4aa
|
@ -8,12 +8,16 @@ import StatusQ.Controls 0.1
|
|||
|
||||
import shared 1.0
|
||||
import shared.popups 1.0
|
||||
import shared.views.chat 1.0
|
||||
|
||||
import utils 1.0
|
||||
|
||||
import "../views"
|
||||
import "../panels"
|
||||
|
||||
Popup {
|
||||
id: activityCenter
|
||||
|
||||
enum Filter {
|
||||
All,
|
||||
Mentions,
|
||||
|
@ -28,11 +32,13 @@ Popup {
|
|||
property bool hideReadNotifications: false
|
||||
property var store
|
||||
property var chatSectionModule
|
||||
property var messageContextMenu
|
||||
property var messageContextMenu: MessageContextMenuView {
|
||||
store: activityCenter.store
|
||||
reactionModel: activityCenter.store.emojiReactionsModel
|
||||
}
|
||||
|
||||
readonly property int unreadNotificationsCount : activityCenter.store.activityCenterList.unreadCount
|
||||
|
||||
id: activityCenter
|
||||
modal: false
|
||||
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
|
|
@ -2,3 +2,4 @@ PinnedMessagesPopup 1.0 PinnedMessagesPopup.qml
|
|||
ChooseBrowserPopup 1.0 ChooseBrowserPopup.qml
|
||||
InviteFriendsToCommunityPopup 1.0 community/InviteFriendsToCommunityPopup.qml
|
||||
CommunityProfilePopup 1.0 community/CommunityProfilePopup.qml
|
||||
ActivityCenterPopup 1.0 ActivityCenterPopup.qml
|
||||
|
|
|
@ -155,12 +155,6 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
MessageContextMenuView {
|
||||
id: contextmenu
|
||||
store: root.rootStore
|
||||
reactionModel: root.rootStore.emojiReactionsModel
|
||||
}
|
||||
|
||||
EmptyChatPanel {
|
||||
anchors.fill: parent
|
||||
visible: root.activeChatId === "" || root.chatsCount == 0
|
||||
|
@ -233,14 +227,14 @@ Item {
|
|||
stickersLoaded: root.stickersLoaded
|
||||
isBlocked: model.blocked
|
||||
isActiveChannel: categoryChatLoader.isActiveChannel
|
||||
activityCenterVisible: activityCenter.visible
|
||||
activityCenterNotificationsCount: activityCenter.unreadNotificationsCount
|
||||
activityCenterVisible: Global.activityCenterPopupOpened
|
||||
activityCenterNotificationsCount: root.rootStore.activityCenterList.unreadCount
|
||||
pinnedMessagesPopupComponent: root.pinnedMessagesListPopupComponent
|
||||
onOpenStickerPackPopup: {
|
||||
root.openStickerPackPopup(stickerPackId)
|
||||
}
|
||||
onNotificationButtonClicked: {
|
||||
activityCenter.open();
|
||||
Global.openActivityCenterPopup()
|
||||
}
|
||||
onOpenAppSearch: {
|
||||
root.openAppSearch();
|
||||
|
@ -297,7 +291,7 @@ Item {
|
|||
root.openStickerPackPopup(stickerPackId)
|
||||
}
|
||||
onNotificationButtonClicked: {
|
||||
activityCenter.open();
|
||||
Global.openActivityCenterPopup()
|
||||
}
|
||||
onOpenAppSearch: {
|
||||
root.openAppSearch();
|
||||
|
@ -414,15 +408,6 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
ActivityCenterPopup {
|
||||
id: activityCenter
|
||||
height: root.height - 56 * 2 // TODO get screen size // Taken from old code top bar height was fixed there to 56
|
||||
y: 56
|
||||
store: root.rootStore
|
||||
chatSectionModule: root.parentModule
|
||||
messageContextMenu: contextmenu
|
||||
}
|
||||
|
||||
// Not Refactored Yet
|
||||
// Connections {
|
||||
// target: root.rootStore.chatsModelInst.stickers
|
||||
|
|
|
@ -12,6 +12,8 @@ import StatusQ.Core.Theme 0.1
|
|||
import utils 1.0
|
||||
import shared.status 1.0
|
||||
|
||||
import "../popups"
|
||||
|
||||
Page {
|
||||
id: root
|
||||
Behavior on anchors.bottomMargin { NumberAnimation { duration: 30 }}
|
||||
|
@ -136,7 +138,7 @@ Page {
|
|||
height: parent.height
|
||||
tooltip.offset: width/2
|
||||
unreadNotificationsCount: activityCenter.unreadNotificationsCount
|
||||
onClicked: activityCenter.open()
|
||||
onClicked: Global.openActivityCenterPopup()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,6 +89,12 @@ Item {
|
|||
popup.openPopup(publicKey, state);
|
||||
Global.profilePopupOpened = true;
|
||||
}
|
||||
|
||||
onOpenActivityCenterPopupRequested: {
|
||||
Global.openPopup(activityCenterPopupComponent)
|
||||
Global.activityCenterPopupOpened = true
|
||||
}
|
||||
|
||||
onOpenChangeProfilePicPopup: {
|
||||
var popup = changeProfilePicComponent.createObject(appMain);
|
||||
popup.chooseImageToCrop();
|
||||
|
@ -762,6 +768,20 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: activityCenterPopupComponent
|
||||
ActivityCenterPopup {
|
||||
id: activityCenter
|
||||
height: appView.height - 56 * 2 // TODO get screen size // Taken from old code top bar height was fixed there to 56
|
||||
y: 56
|
||||
store: chatLayoutContainer.rootStore
|
||||
chatSectionModule: chatLayoutContainer.rootStore.chatCommunitySectionModule
|
||||
onClosed: {
|
||||
Global.activityCenterPopupOpened = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DropArea {
|
||||
id: dragTarget
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ QtObject {
|
|||
property var inviteFriendsToCommunityPopup
|
||||
property bool profilePopupOpened: false
|
||||
|
||||
property bool activityCenterPopupOpened: false
|
||||
|
||||
property var sendMessageSound
|
||||
property var notificationSound
|
||||
property var errorSound
|
||||
|
@ -37,11 +39,16 @@ QtObject {
|
|||
signal openChangeProfilePicPopup()
|
||||
signal displayToastMessage(string title, string subTitle, string icon, bool loading, int ephNotifType, string url)
|
||||
signal openEditDisplayNamePopup()
|
||||
signal openActivityCenterPopupRequested
|
||||
|
||||
function openProfilePopup(publicKey, parentPopup, state = "") {
|
||||
openProfilePopupRequested(publicKey, parentPopup, state);
|
||||
}
|
||||
|
||||
function openActivityCenterPopup() {
|
||||
openActivityCenterPopupRequested()
|
||||
}
|
||||
|
||||
function openPopup(popupComponent, params = {}) {
|
||||
const popup = popupComponent.createObject(root.appMain, params);
|
||||
popup.open();
|
||||
|
|
Loading…
Reference in New Issue