diff --git a/ui/app/AppLayouts/Chat/popups/ActivityCenterPopup.qml b/ui/app/AppLayouts/Chat/popups/ActivityCenterPopup.qml index fb209ab200..9559124772 100644 --- a/ui/app/AppLayouts/Chat/popups/ActivityCenterPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/ActivityCenterPopup.qml @@ -8,16 +8,12 @@ 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, @@ -32,13 +28,11 @@ Popup { property bool hideReadNotifications: false property var store property var chatSectionModule - property var messageContextMenu: MessageContextMenuView { - store: activityCenter.store - reactionModel: activityCenter.store.emojiReactionsModel - } + property var messageContextMenu readonly property int unreadNotificationsCount : activityCenter.store.activityCenterList.unreadCount + id: activityCenter modal: false closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside diff --git a/ui/app/AppLayouts/Chat/popups/qmldir b/ui/app/AppLayouts/Chat/popups/qmldir index bc5e8a7a47..8aeceb4612 100644 --- a/ui/app/AppLayouts/Chat/popups/qmldir +++ b/ui/app/AppLayouts/Chat/popups/qmldir @@ -2,4 +2,3 @@ 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 diff --git a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml index b0ba425d61..0e46f1de9d 100644 --- a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml @@ -155,6 +155,12 @@ Item { } } + MessageContextMenuView { + id: contextmenu + store: root.rootStore + reactionModel: root.rootStore.emojiReactionsModel + } + EmptyChatPanel { anchors.fill: parent visible: root.activeChatId === "" || root.chatsCount == 0 @@ -227,14 +233,14 @@ Item { stickersLoaded: root.stickersLoaded isBlocked: model.blocked isActiveChannel: categoryChatLoader.isActiveChannel - activityCenterVisible: Global.activityCenterPopupOpened - activityCenterNotificationsCount: root.rootStore.activityCenterList.unreadCount + activityCenterVisible: activityCenter.visible + activityCenterNotificationsCount: activityCenter.unreadNotificationsCount pinnedMessagesPopupComponent: root.pinnedMessagesListPopupComponent onOpenStickerPackPopup: { root.openStickerPackPopup(stickerPackId) } onNotificationButtonClicked: { - Global.openActivityCenterPopup() + activityCenter.open(); } onOpenAppSearch: { root.openAppSearch(); @@ -291,7 +297,7 @@ Item { root.openStickerPackPopup(stickerPackId) } onNotificationButtonClicked: { - Global.openActivityCenterPopup() + activityCenter.open(); } onOpenAppSearch: { root.openAppSearch(); @@ -408,6 +414,15 @@ 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 diff --git a/ui/app/AppLayouts/Chat/views/CreateChatView.qml b/ui/app/AppLayouts/Chat/views/CreateChatView.qml index 7bf3fe9404..ed1654f1de 100644 --- a/ui/app/AppLayouts/Chat/views/CreateChatView.qml +++ b/ui/app/AppLayouts/Chat/views/CreateChatView.qml @@ -12,8 +12,6 @@ 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 }} @@ -138,7 +136,7 @@ Page { height: parent.height tooltip.offset: width/2 unreadNotificationsCount: activityCenter.unreadNotificationsCount - onClicked: Global.openActivityCenterPopup() + onClicked: activityCenter.open() } } } diff --git a/ui/app/mainui/AppMain.qml b/ui/app/mainui/AppMain.qml index 63f5828924..54e4e94651 100644 --- a/ui/app/mainui/AppMain.qml +++ b/ui/app/mainui/AppMain.qml @@ -89,12 +89,6 @@ Item { popup.openPopup(publicKey, state); Global.profilePopupOpened = true; } - - onOpenActivityCenterPopupRequested: { - Global.openPopup(activityCenterPopupComponent) - Global.activityCenterPopupOpened = true - } - onOpenChangeProfilePicPopup: { var popup = changeProfilePicComponent.createObject(appMain); popup.chooseImageToCrop(); @@ -768,20 +762,6 @@ 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 diff --git a/ui/imports/utils/Global.qml b/ui/imports/utils/Global.qml index 3e1e900b66..4d7b63a58a 100644 --- a/ui/imports/utils/Global.qml +++ b/ui/imports/utils/Global.qml @@ -19,8 +19,6 @@ QtObject { property var inviteFriendsToCommunityPopup property bool profilePopupOpened: false - property bool activityCenterPopupOpened: false - property var sendMessageSound property var notificationSound property var errorSound @@ -39,16 +37,11 @@ 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();