feat(ActivityCenter): Refactor AC from chat and place in mainui

Close #7338
This commit is contained in:
MishkaRogachev 2022-09-13 17:20:10 +03:00 committed by Mikhail Rogachev
parent a2f48eef49
commit 25c5be2f78
21 changed files with 38 additions and 80 deletions

View File

@ -1,24 +0,0 @@
import QtQuick 2.14
import shared 1.0
import shared.panels 1.0
import StatusQ.Controls 0.1 as StatusQ
import utils 1.0
StyledText {
id: chatTime
color: Style.current.secondaryText
text: Utils.formatShortTime(timestamp)
font.pixelSize: Style.current.asideTextFontSize
property int timestamp
StatusQ.StatusToolTip {
visible: hhandler.hovered
text: Utils.formatLongDateTime(chatTime.timestamp, RootStore.accountSensitiveSettings.isDDMMYYDateFormat, RootStore.accountSensitiveSettings.is24hTimeFormat)
maxWidth: 350
}
HoverHandler {
id: hhandler
}
}

View File

@ -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

View File

@ -58,7 +58,6 @@ StatusSectionLayout {
}
notificationButton.tooltip.offset: localAccountSensitiveSettings.expandUsersList && headerContent.membersButton.visible ? 0 : 14
notificationButton.highlighted: activityCenter.visible
onNotificationButtonClicked: Global.openActivityCenterPopup()
notificationCount: root.rootStore.unreadNotificationsCount
@ -201,16 +200,7 @@ StatusSectionLayout {
}
}
ActivityCenterPopup {
id: activityCenter
y: 56
height: (root.height - 56) * 2 // TODO get screen size // Taken from old code top bar height was fixed there to 56
store: root.rootStore
chatSectionModule: root.rootStore.currentChatContentModule()
messageContextMenu: MessageContextMenuView {
id: contextmenu
store: root.rootStore
reactionModel: root.rootStore.emojiReactionsModel
}
Component.onCompleted: {
rootStore.groupInfoPopupComponent = groupInfoPopupComponent;
}
}

View File

@ -38,6 +38,7 @@ import AppLayouts.Browser.stores 1.0 as BrowserStores
import AppLayouts.stores 1.0
import "popups"
import "activitycenter/popups"
Item {
id: appMain

View File

@ -0,0 +1,3 @@
ChannelBadge 1.0 ChannelBadge.qml
CommunityBadge 1.0 CommunityBadge.qml
ReplyComponent 1.0 ReplyComponent.qml

View File

@ -9,7 +9,6 @@ import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
import ".."
import "../popups"
Item {

View File

@ -8,7 +8,7 @@ import shared 1.0
import shared.panels 1.0
import shared.status 1.0
import "../controls/activityCenter" as ActivityCenter
import "../controls"
Rectangle {
id: wrapper
@ -55,7 +55,8 @@ Rectangle {
Component {
id: replyComponent
ActivityCenter.ReplyComponent {
ReplyComponent {
width: childrenRect.width
height: parent.height
repliedMessageContent: wrapper.repliedMessageContent
@ -64,7 +65,8 @@ Rectangle {
Component {
id: communityBadgeComponent
ActivityCenter.CommunityBadge {
CommunityBadge {
width: childrenRect.width
height: parent.height
@ -82,7 +84,8 @@ Rectangle {
Component {
id: channelBadgeComponent
ActivityCenter.ChannelBadge {
ChannelBadge {
width: childrenRect.width
height: parent.height

View File

@ -0,0 +1,2 @@
ActivityCenterPopupTopBarPanel 1.0 ActivityCenterPopupTopBarPanel.qml
ActivityChannelBadgePanel 1.0 ActivityChannelBadgePanel.qml

View File

@ -92,6 +92,7 @@ Popup {
}
}
// TODO: replace with StatusListView
StatusScrollView {
id: scrollView
anchors.left: parent.left
@ -109,33 +110,6 @@ Popup {
width: scrollView.availableWidth
spacing: 0
// TODO remove this once it is handled by the activity center
// Repeater {
// id: contactList
// model: root.store.contactRequests
// delegate: ContactRequest {
// visible: !hideReadNotifications &&
// (root.currentActivityCategory === ActivityCenter.ActivityCategory.All ||
// root.currentActivityCategory === ActivityCenter.ActivityCategory.ContactRequests)
// name: Utils.removeStatusEns(model.name)
// address: model.address
// localNickname: model.localNickname
// identicon: model.thumbnailImage || model.identicon
// // TODO set to transparent bg if the notif is read
// color: Utils.setColorAlpha(Style.current.blue, 0.1)
// radius: 0
// profileClick: function (showFooter, userName, fromAuthor, identicon, textParam, nickName) {
// Global.openProfilePopup(fromAuthor)
// }
// onBlockContactActionTriggered: {
// blockContactConfirmationDialog.contactName = name
// blockContactConfirmationDialog.contactAddress = address
// blockContactConfirmationDialog.open()
// }
// }
// }
Repeater {
model: notifDelegateList
}

View File

@ -0,0 +1 @@
ActivityCenterPopup 1.0 ActivityCenterPopup.qml

View File

@ -0,0 +1,10 @@
import QtQuick 2.13
import utils 1.0
import StatusQ.Core.Utils 0.1 as StatusQUtils
QtObject {
id: root
// TODO: move AC-related stuff from chat here
}

View File

@ -0,0 +1 @@
RootStore 1.0 RootStore.qml

View File

@ -1,20 +1,21 @@
import QtQuick 2.13
import QtGraphicalEffects 1.13
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
import shared.controls 1.0
import shared 1.0
import shared.panels 1.0
import shared.popups 1.0
import shared.panels.chat 1.0
import shared.controls.chat 1.0
import "../controls"
import "../panels"
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1
Item {
id: root
width: parent.width

View File

@ -1,13 +1,12 @@
import QtQuick 2.13
import utils 1.0
import StatusQ.Controls 0.1
import utils 1.0
import shared 1.0
import shared.views 1.0
import shared.popups 1.0
import shared.panels 1.0
import shared.views.chat 1.0
import "../controls"

View File

@ -0,0 +1,2 @@
ActivityCenterGroupRequest 1.0 ActivityCenterGroupRequest.qml
ActivityCenterMessageComponentView 1.0 ActivityCenterMessageComponentView.qml

View File

@ -1,5 +1 @@
ChatTimePanel 1.0 ChatTimePanel.qml
EmojiReactionsPanel 1.0 EmojiReactionsPanel.qml
ChatReplyPanel 1.0 ChatReplyPanel.qml
ChatButtonsPanel 1.0 ChatButtonsPanel.qml
AudioPlayerPanel 1.0 AudioPlayerPanel.qml

View File

@ -21,3 +21,4 @@ TextWithLabel 1.0 TextWithLabel.qml
EditCroppedImagePanel 1.0 EditCroppedImagePanel.qml
NoImageUploadedPanel 1.0 NoImageUploadedPanel.qml
StatusAssetSelector 1.0 StatusAssetSelector.qml
AcceptRejectOptionsButtonsPanel 1.0 AcceptRejectOptionsButtonsPanel.qml