refactor(desktop/chat) Moving chat to new architecture

Closes #3710
This commit is contained in:
Alexandra Betouni 2021-10-01 18:58:36 +03:00 committed by Iuri Matias
parent fe6c5a455a
commit 9cc361c40a
134 changed files with 2139 additions and 1164 deletions

View File

@ -12,12 +12,13 @@ import utils 1.0
import "../../../shared"
import "../../../shared/controls"
import "../../../shared/status"
import "../Chat/ChatColumn/ChatComponents"
import "popups"
import "controls"
import "views"
import "panels"
import "stores"
import "../Chat/popups"
// Code based on https://code.qt.io/cgit/qt/qtwebengine.git/tree/examples/webengine/quicknanobrowser/BrowserWindow.qml?h=5.15
// Licensed under BSD

View File

@ -2,11 +2,13 @@ import QtQuick 2.13
import QtQuick.Controls 2.3
import QtWebEngine 1.9
import utils 1.0
import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/status"
import "../../Chat/ChatColumn/ChatComponents"
import "../../Chat/popups"
// TODO: replace with StatusPopupMenu
PopupMenu {

View File

@ -8,7 +8,8 @@ import "../../../../shared/status"
import "../stores"
import utils 1.0
import "../../Chat/ChatColumn/ChatComponents"
import "../../Chat/popups"
// TODO: replace with StatusPopupMenu
PopupMenu {

View File

@ -1,103 +0,0 @@
import QtQuick 2.13
import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/controls"
import "../../../../../shared/status"
import ".."
import "../../components"
Rectangle {
property string chatId: ""
property string name: "channelName"
property string identicon
property string responseTo
property string communityId
property int notificationType
property int chatType: chatsModel.channelView.chats.getChannelType(chatId)
property int realChatType: {
if (chatType === Constants.chatTypeCommunity) {
// TODO add a check for private community chats once it is created
return Constants.chatTypePublic
}
return chatType
}
property string profileImage: realChatType === Constants.chatTypeOneToOne ? appMain.getProfileImage(chatId) || "" : ""
id: wrapper
height: visible ? 24 : 0
width: childrenRect.width + 12
color: Style.current.transparent
border.color: Style.current.borderSecondary
border.width: 1
radius: 11
Loader {
active: true
height: parent.height
anchors.left: parent.left
anchors.leftMargin: 4
sourceComponent: {
switch (model.notificationType) {
case Constants.activityCenterNotificationTypeMention: return communityOrChannelContentComponent
case Constants.activityCenterNotificationTypeReply: return replyComponent
default: return communityOrChannelContentComponent
}
}
}
Component {
id: replyComponent
Item {
property int replyMessageIndex: chatsModel.messageView.getMessageIndex(chatId, responseTo)
property string repliedMessageContent: replyMessageIndex > -1 ? chatsModel.messageView.getMessageData(chatId, replyMessageIndex, "message") : "";
onReplyMessageIndexChanged: {
wrapper.visible = replyMessageIndex > -1
}
width: childrenRect.width
height: parent.height
SVGImage {
id: replyIcon
width: 16
height: 16
source: Style.svg("reply-small-arrow")
anchors.left: parent.left
anchors.verticalCenter:parent.verticalCenter
}
StyledTextEdit {
text: Utils.getReplyMessageStyle(Emoji.parse(Utils.linkifyAndXSS(repliedMessageContent), Emoji.size.small), false, appSettings.useCompactMode)
textFormat: Text.RichText
height: 18
width: implicitWidth > 300 ? 300 : implicitWidth
clip: true
anchors.left: replyIcon.right
anchors.leftMargin: 4
color: Style.current.secondaryText
font.weight: Font.Medium
font.pixelSize: 13
anchors.verticalCenter: parent.verticalCenter
selectByMouse: true
readOnly: true
}
}
}
Component {
id: communityOrChannelContentComponent
BadgeContent {
chatId: wrapper.chatId
name: wrapper.name
identicon: wrapper.identicon
communityId: wrapper.communityId
}
}
}

View File

@ -1,70 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/panels"
Rectangle {
property color iconColor
property string text: "My command"
property url iconSource: Style.svg("send")
property bool rotatedImage: false
property var onClicked: function () {}
id: root
width: 168
height: 95
radius: 16
color: Utils.setColorAlpha(iconColor, 0.2)
Rectangle {
id: iconBox
radius: 50
color: iconColor
anchors.top: parent.top
anchors.topMargin: Style.current.smallPadding
anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding
height: iconImage.height + Style.current.smallPadding * 2
width: this.height
SVGImage {
id: iconImage
source: Style.svg("send")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: 16
fillMode: Image.PreserveAspectFit
rotation: rotatedImage ? 180 : 0
antialiasing: true
}
ColorOverlay {
anchors.fill: iconImage
source: iconImage
color: Style.current.white
rotation: rotatedImage ? 180 : 0
antialiasing: true
}
}
StyledText {
text: root.text
anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding
anchors.bottom: parent.bottom
anchors.bottomMargin: Style.current.smallPadding
font.weight: Font.Medium
font.pixelSize: 13
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
root.onClicked()
}
}
}

View File

@ -1,62 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/panels"
Rectangle {
property url source: Style.svg("emojiBtn")
property bool hovered: false
property bool opened: false
property var close: function () {}
property var open: function () {}
id: root
width: this.visible ? buttonIcon.width + 4 + chatButtonsContainer.iconPadding * 2 : 0
height: this.visible ? buttonIcon.height + chatButtonsContainer.iconPadding * 2 : 0
radius: Style.current.radius
color: hovered ? Style.current.secondaryBackground : Style.current.transparent
anchors.verticalCenter: parent.verticalCenter
SVGImage {
id: buttonIcon
visible: txtData.length === 0
source: root.source
width: 20
height: 20
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
}
ColorOverlay {
anchors.fill: buttonIcon
source: buttonIcon
color: root.hovered || root.opened ? Style.current.blue : Style.current.darkGrey
}
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
hoverEnabled: true
onEntered: {
root.hovered = true
}
onExited: {
root.hovered = false
}
onClicked: {
if (root.opened) {
root.close()
} else {
root.open()
}
}
}
}
/*##^##
Designer {
D{i:0;formeditorZoom:1.5}
}
##^##*/

View File

@ -1,35 +0,0 @@
import QtQuick 2.13
import "../../../../../shared"
import utils 1.0
MouseArea {
enabled: !placeholderMessage
cursorShape: chatText.hoveredLink ? Qt.PointingHandCursor : undefined
acceptedButtons: Qt.LeftButton | Qt.RightButton
z: 50
onClicked: {
if (activityCenterMessage) {
return clickMessage(false, isSticker, false)
}
if(mouse.button === Qt.RightButton) {
// Set parent, X & Y positions for the messageContextMenu
messageContextMenu.parent = root
messageContextMenu.setXPosition = function() { return (mouse.x)}
messageContextMenu.setYPosition = function() { return (mouse.y)}
clickMessage(false, isSticker, false)
if (typeof isMessageActive !== "undefined") {
setMessageActive(messageId, true)
}
return;
}
if (mouse.button === Qt.LeftButton && isSticker && stickersLoaded) {
if (isHovered) {
isHovered = false
}
openPopup(statusStickerPackClickPopup, {packId: stickerPackId} )
return;
}
}
}

View File

@ -1,77 +0,0 @@
import QtQuick 2.3
import "../../../../../../shared"
import "../../../../../../shared/controls"
import "../../../../../../shared/panels"
import utils 1.0
import "../../ChatComponents"
Item {
id: root
width: parent.width
height: childrenRect.height + Style.current.halfPadding
Separator {
id: separator
}
StyledText {
id: signText
color: Style.current.blue
//% "Sign and send"
text: qsTrId("sign-and-send")
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
font.weight: Font.Medium
anchors.right: parent.right
anchors.left: parent.left
topPadding: Style.current.halfPadding
anchors.top: separator.bottom
font.pixelSize: 15
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
walletModel.accountsView.setFocusedAccountByAddress(commandParametersObject.fromAddress)
var acc = walletModel.accountsView.focusedAccount
openPopup(signTxComponent, {selectedAccount: {
name: acc.name,
address: commandParametersObject.fromAddress,
iconColor: acc.iconColor,
assets: acc.assets
}})
}
}
}
Component {
id: signTxComponent
SignTransactionModal {
onOpened: {
walletModel.gasView.getGasPrice()
}
onClosed: {
destroy();
}
selectedRecipient: {
return {
address: commandParametersObject.address,
identicon: chatsModel.channelView.activeChannel.identicon,
name: chatsModel.channelView.activeChannel.name,
type: RecipientSelector.Type.Contact
}
}
selectedAsset: token
selectedAmount: tokenAmount
selectedFiatAmount: fiatValue
}
}
}
/*##^##
Designer {
D{i:0;formeditorColor:"#ffffff";formeditorZoom:1.25}
}
##^##*/

View File

@ -1,55 +0,0 @@
import QtQuick 2.3
import "../../../../../shared"
import "../../../../../shared/panels"
import utils 1.0
Loader {
property int imageHeight: 36
property int imageWidth: 36
property string identiconImageSource: identicon
property string profileImage: profileImageSource
property bool isReplyImage: false
id: root
active: isMessage
height: active ? item.height : 0
sourceComponent: Component {
Item {
id: chatImage
width: identiconImage.width
height: identiconImage.height
RoundedImage {
id: identiconImage
width: root.imageWidth
height: root.imageHeight
border.width: 1
border.color: Style.current.border
source: {
if (root.profileImage) {
return root.profileImage
}
identiconImage.showLoadingIndicator = false
return !isCurrentUser || isReplyImage ? root.identiconImageSource : profileModel.profile.identicon
}
smooth: false
antialiasing: true
MouseArea {
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: parent
onClicked: {
// Set parent, X & Y positions for the messageContextMenu
messageContextMenu.parent = root
messageContextMenu.setXPosition = function() { return root.width + 4}
messageContextMenu.setYPosition = function() { return root.height/2 + 4}
clickMessage(true, false, false, null, false, false, isReplyImage)
}
}
}
}
}
}

View File

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

View File

@ -1,8 +0,0 @@
TopBar 1.0 TopBar.qml
ChatMessages 1.0 ChatMessages.qml
ChatInput 1.0 ChatInput.qml
EmptyChat 1.0 EmptyChat.qml
ChatButtons 1.0 ChatButtons.qml
ReplyArea 1.0 ReplyArea.qml
Message 1.0 Message.qml
CompactMessage 1.0 CompactMessage.qml

View File

@ -1,3 +0,0 @@
MessagesData 1.0 MessagesData.qml
StickerData 1.0 StickerData.qml
StickerPackData 1.0 StickerPackData.qml

View File

@ -7,11 +7,14 @@ import "../../../shared"
import "../../../shared/popups"
import "../../../shared/panels"
import "../../../shared/status"
import "."
import "./data"
import "components"
import "./ChatColumn"
import "./CommunityComponents"
import "views"
import "panels"
import "panels/communities"
import "popups"
import "helpers"
import "controls"
import "stores"
import StatusQ.Layout 0.1
import StatusQ.Popups 0.1
@ -21,6 +24,10 @@ StatusAppThreePanelLayout {
handle: SplitViewHandle { implicitWidth: 5 }
property var messageStore
property RootStore rootStore: RootStore {
messageStore: chatView.messageStore
}
property alias chatColumn: chatColumn
property bool stickersLoaded: false
signal profileButtonClicked()
@ -157,8 +164,9 @@ StatusAppThreePanelLayout {
sourceComponent: appSettings.communitiesEnabled && chatsModel.communities.activeCommunity.active ? communtiyColumnComponent : contactsColumnComponent
}
centerPanel: ChatColumn {
centerPanel: ChatColumnView {
id: chatColumn
rootStore: chatView.rootStore
chatGroupsListViewCount: contactColumnLoader.item.chatGroupsListViewCount
}
@ -168,17 +176,29 @@ StatusAppThreePanelLayout {
Component {
id: communityUserListComponent
CommunityUserList { currentTime: chatColumn.currentTime; messageContextMenu: quickActionMessageOptionsMenu }
CommunityUserListPanel {
currentTime: chatColumn.currentTime
messageContextMenu: quickActionMessageOptionsMenu
profilePubKey: profileModel.profile.pubKey
contactsList: profileModel.contacts.list
}
}
Component {
id: userListComponent
UserList { currentTime: chatColumn.currentTime; userList: chatColumn.userList; messageContextMenu: quickActionMessageOptionsMenu}
UserListPanel {
currentTime: chatColumn.currentTime
userList: chatColumn.userList
messageContextMenu: quickActionMessageOptionsMenu
profilePubKey: profileModel.profile.pubKey
contactsList: profileModel.contacts.list
isOnline: chatsModel.isOnline
}
}
Component {
id: contactsColumnComponent
ContactsColumn {
ContactsColumnView {
onOpenProfileClicked: {
chatView.profileButtonClicked();
}
@ -187,7 +207,7 @@ StatusAppThreePanelLayout {
Component {
id: communtiyColumnComponent
CommunityColumn {
CommunityColumnView {
pinnedMessagesPopupComponent: chatColumn.pinnedMessagesPopupComponent
}
}
@ -223,9 +243,9 @@ StatusAppThreePanelLayout {
}
}
MessageContextMenu {
MessageContextMenuPanel {
id: quickActionMessageOptionsMenu
reactionModel: EmojiReactions { }
reactionModel: chatColumn.rootStore.emojiReactionsModel
}
}

View File

@ -1,70 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import "../../../../shared"
import "../../../../shared/panels"
import utils 1.0
import "../components"
import "./"
Rectangle {
property int nbRequests: chatsModel.communities.activeCommunity.communityMembershipRequests.nbRequests
id: membershipRequestsBtn
visible: nbRequests > 0
width: parent.width
height: visible ? 52 : 0
color: Style.current.secondaryBackground
StyledText {
//% "Membership requests"
text: qsTrId("membership-requests")
font.pixelSize: 15
anchors.left: parent.left
anchors.leftMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
id: badge
anchors.right: caret.left
anchors.rightMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter
color: Style.current.blue
width: 22
height: 22
radius: width / 2
Text {
font.pixelSize: 12
color: Style.current.white
anchors.centerIn: parent
text: membershipRequestsBtn.nbRequests.toString()
}
}
SVGImage {
id: caret
source: Style.svg("caret")
fillMode: Image.PreserveAspectFit
rotation: -90
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter
width: 13
height: 7
ColorOverlay {
anchors.fill: parent
source: parent
color: Style.current.darkGrey
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: membershipRequestPopup.open()
}
}

View File

@ -1,2 +0,0 @@
EmptyView 1.0 EmptyView.qml
ClosedEmptyView 1.0 ClosedEmptyView.qml

View File

@ -1,73 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/panels"
Item {
property string channelName
property int channelType
property string channelIdenticon
readonly property int defaultFontSize: 21
property int fontSize: defaultFontSize
id: contactImage
width: 36
height: 36
Loader {
sourceComponent: channelType == Constants.chatTypeOneToOne ? imageIdenticon : letterIdenticon
anchors.fill: parent
}
Component {
id: letterIdenticon
Rectangle {
width: contactImage.width
height: contactImage.height
radius: 50
color: {
const color = chatsModel.channelView.getChannelColor(channelName)
if (!color) {
return Style.current.transparent
}
return color
}
StyledText {
text: {
if (channelType == Constants.chatTypeOneToOne) {
return channelName
} else {
return (channelName.charAt(0) == "#" ? channelName.charAt(1) : channelName.charAt(0)).toUpperCase()
}
}
opacity: 0.7
font.weight: Font.Bold
font.pixelSize: fontSize
color: "white"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
}
Component {
id: imageIdenticon
Rectangle {
width: contactImage.width ? contactImage.width : 40
height: contactImage.height ? contactImage.height : 40
radius: 50
border.color: Style.current.border
border.width: 1
color: Style.current.background
SVGImage {
width: contactImage.width ? contactImage.width : 40
height: contactImage.height ? contactImage.height : 40
fillMode: Image.PreserveAspectFit
source: channelIdenticon
}
}
}
}

View File

@ -1,13 +0,0 @@
SuggestedChannel 1.0 SuggestedChannel.qml
PublicChatPopup 1.0 PublicChatPopup.qml
PrivateChatPopup 1.0 PrivateChatPopup.qml
GroupInfoPopup 1.0 GroupInfoPopup.qml
ProfilePropup 1.0 ProfilePopup.qml
ChannelIcon 1.0 ChannelIcon.qml
RenameGroupPopup 1.0 RenameGroupPopup.qml
GroupChatPopup 1.0 GroupChatPopup.qml
StickerButton 1.0 StickerButton.qml
StickerMarket 1.0 StickerMarket.qml
StickersPopup 1.0 StickersPopup.qml
StickerPackIconWithIndicator 1.0 StickerPackIconWithIndicator.qml
SuggestedChannels 1.0 SuggestedChannels.qml

View File

@ -1,6 +1,7 @@
import QtQuick 2.3
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../shared"
import "../../../../shared/panels"
import utils 1.0

View File

@ -6,10 +6,10 @@ import "../../../../shared/panels"
Rectangle {
property alias source: reactionImage.source
property var closeModal: function () {}
property int emojiId
property bool reactedByUser: false
property bool isHovered: false
signal closeModal()
id: root
width: reactionImage.width + Style.current.halfPadding
@ -34,8 +34,7 @@ Rectangle {
onEntered: root.isHovered = true
onExited: root.isHovered = false
onClicked: {
chatsModel.toggleReaction(SelectedMessage.messageId, emojiId)
root.closeModal()
root.closeModal();
}
}
}

View File

@ -4,7 +4,7 @@ import QtQuick.Layouts 1.13
import "./" as MessageComponents
import utils 1.0
import "../../../../../shared"
import "../../../../shared"
Item {
id: root
@ -93,4 +93,4 @@ Item {
height: root.height
}
}
}
}

View File

@ -0,0 +1,51 @@
import QtQuick 2.13
import "../../../../shared"
import utils 1.0
MouseArea {
z: 50
enabled: !placeholderMessage
property bool isHovered: false
property bool isSticker: false
property bool placeholderMessage: false
property bool isActivityCenterMessage: false
property var isMessageActive
property var messageContextMenu
signal setMessageActive(string messageId, bool active)
signal clickMessage(bool isProfileClick, bool isSticker, bool isImage)
cursorShape: !enabled ? Qt.PointingHandCursor : undefined
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: {
if (isActivityCenterMessage) {
return clickMessage(false, isSticker, false)
}
if (mouse.button === Qt.RightButton) {
if (!!messageContextMenu) {
// Set parent, X & Y positions for the messageContextMenu
//TODO remove dynamic scoping
messageContextMenu.parent = root
messageContextMenu.setXPosition = function() { return (mouse.x)};
messageContextMenu.setYPosition = function() { return (mouse.y)};
}
clickMessage(false, isSticker, false)
if (typeof isMessageActive !== "undefined") {
setMessageActive(messageId, true)
}
return;
}
//TODO remove dynamic scoping
if (mouse.button === Qt.LeftButton && isSticker && stickersLoaded) {
if (isHovered) {
isHovered = false;
}
//TODO remove dynamic scoping
openPopup(statusStickerPackClickPopup, {packId: stickerPackId} )
return;
}
}
}

View File

@ -5,6 +5,7 @@ Rectangle {
color: parent.color
width: 18
height: 18
property bool isCurrentUser: false
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.left: !isCurrentUser ? parent.left : undefined

View File

@ -1,7 +1,7 @@
import QtQuick 2.3
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../shared"
import "../../../../shared/panels"
import utils 1.0
@ -12,11 +12,15 @@ StyledText {
text: qsTrId("resend-message")
font.pixelSize: Style.current.tertiaryTextFontSize
visible: isCurrentUser && (timeout || isExpired)
property bool isCurrentUser: false
property bool isExpired: false
property bool timeout: false
signal clicked()
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
chatsModel.messageView.resendMessage(chatId, messageId)
retryLbl.clicked();
}
}
}

View File

@ -0,0 +1,72 @@
import QtQuick 2.3
import utils 1.0
import "../../../../shared"
import "../../../../shared/panels"
import "../popups"
Item {
id: root
width: parent.width
height: childrenRect.height + Style.current.halfPadding
property var acc
property string fromAddress
property var selectedRecipient
property var selectedAsset
property string selectedAmount
property string selectedFiatAmount
signal signModalOpened()
signal sendTransaction(string address)
Separator {
id: separator
}
StyledText {
id: signText
color: Style.current.blue
//% "Sign and send"
text: qsTrId("sign-and-send")
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
font.weight: Font.Medium
anchors.right: parent.right
anchors.left: parent.left
topPadding: Style.current.halfPadding
anchors.top: separator.bottom
font.pixelSize: 15
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
root.clicked(root.fromAddress);
//TODO remove dynamic scoping
openPopup(signTxComponent, {selectedAccount: {
name: root.acc.name,
address: root.fromAddress,
iconColor: root.acc.iconColor,
assets: root.acc.assets
}})
}
}
}
Component {
id: signTxComponent
SignTransactionModal {
selectedAsset: root.selectedAsset
selectedAmount: root.selectedAmount
selectedRecipient: root.selectedRecipient
selectedFiatAmount: root.selectedFiatAmount
onOpened: {
root.signModalOpened();
}
onClosed: {
destroy();
}
}
}
}

View File

@ -1,5 +1,5 @@
import QtQuick 2.3
import "../../../../../shared/panels"
import "../../../../shared/panels"
import utils 1.0

View File

@ -1,7 +1,7 @@
import QtQuick 2.3
import QtGraphicalEffects 1.13
import "../../../../../../shared"
import "../../../../../../shared/panels"
import "../../../../shared"
import "../../../../shared/panels"
import utils 1.0
@ -89,9 +89,3 @@ Rectangle {
font.pixelSize: 13
}
}
/*##^##
Designer {
D{i:0;formeditorColor:"#808080";formeditorZoom:2}
}
##^##*/

View File

@ -5,8 +5,9 @@ import "../../../../shared"
import "../../../../shared/panels"
Rectangle {
id: root
property string channel: "status"
signal clicked(string channel)
border.width: 1
radius: 8
width: children[0].width + 10
@ -30,7 +31,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
onClicked: {
chatsModel.channelView.joinPublicChat(channel);
root.clicked(channel);
}
cursorShape: Qt.PointingHandCursor
}

View File

@ -5,7 +5,6 @@ import "../../../../shared/panels"
import "../../../../shared/status"
import utils 1.0
import "../components"
import StatusQ.Components 0.1
import StatusQ.Core.Theme 0.1
@ -13,27 +12,30 @@ import StatusQ.Core.Theme 0.1
Item {
id: wrapper
anchors.right: parent.right
anchors.top: applicationWindow.top
anchors.left: parent.left
height: rectangle.height + 4
property string publicKey: ""
property string profilePubKey
property var contactsList
property string name: "channelName"
property string lastSeen: ""
property string identicon
property int statusType: -1
property bool hovered: false
property bool enableMouseArea: true
property bool isOnline: chatsModel.isOnline
property bool isOnline: false
property var currentTime
property var messageContextMenu
property color color: {
if (wrapper.hovered) {
return Style.current.menuBackgroundHover
}
return Style.current.transparent
return Style.current.transparent
}
//TODO remove dynamic scoping
property string profileImage: appMain.getProfileImage(publicKey) || ""
property bool isCurrentUser: publicKey === profileModel.profile.pubKey
property bool isCurrentUser: (publicKey === profilePubKey)
Rectangle {
id: rectangle
@ -42,7 +44,8 @@ Item {
radius: 8
color: wrapper.color
Connections {
target: profileModel.contacts.list
enabled: !!wrapper.contactsList
target: wrapper.contactsList
onContactChanged: {
if (pubkey === wrapper.publicKey) {
wrapper.profileImage = appMain.getProfileImage(wrapper.publicKey)
@ -120,9 +123,10 @@ Item {
}
onClicked: {
if (mouse.button === Qt.LeftButton) {
//TODO remove dynamic scoping
openProfilePopup(wrapper.name, wrapper.publicKey, (wrapper.profileImage || wrapper.identicon), "", appMain.getUserNickname(wrapper.publicKey));
}
else if (mouse.button === Qt.RightButton) {
else if (mouse.button === Qt.RightButton && !!messageContextMenu) {
// Set parent, X & Y positions for the messageContextMenu
messageContextMenu.parent = rectangle
messageContextMenu.setXPosition = function() { return 0}
@ -132,14 +136,5 @@ Item {
}
}
}
}
}
/*##^##
Designer {
D{i:0;formeditorColor:"#ffffff";height:64;width:640}
}
##^##*/

View File

@ -0,0 +1,60 @@
import QtQuick 2.3
import "../../../../shared"
import "../../../../shared/panels"
import utils 1.0
Loader {
id: root
active: isMessage
height: active ? item.height : 0
property int imageHeight: 36
property int imageWidth: 36
// property string profileImage: ""
// property string identiconImageSource: ""
property bool isReplyImage: false
// property var messageContextMenu
// property bool isCurrentUser: false
// property bool isMessage: false
signal clickMessage(bool isProfileClick, bool isSticker, bool isImage, var image, bool emojiOnly, bool hideEmojiPicker, bool isReply)
sourceComponent: Component {
Item {
id: chatImage
width: identiconImage.width
height: identiconImage.height
RoundedImage {
id: identiconImage
width: root.imageWidth
height: root.imageHeight
border.width: 1
border.color: Style.current.border
source: {
if (profileImageSource) {
return profileImageSource
}
identiconImage.showLoadingIndicator = false
return !isCurrentUser || isReplyImage ? identicon : profileModel.profile.identicon
}
smooth: false
antialiasing: true
MouseArea {
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: parent
onClicked: {
if (!!messageContextMenu) {
// Set parent, X & Y positions for the messageContextMenu
messageContextMenu.parent = root
messageContextMenu.setXPosition = function() { return root.width + 4}
messageContextMenu.setYPosition = function() { return root.height/2 + 4}
}
root.clickMessage(true, false, false, null, false, false, isReplyImage)
}
}
}
}
}
}

View File

@ -1,7 +1,7 @@
import QtQuick 2.3
import "../../../../../shared"
import "../../../../../shared/controls"
import "../../../../../shared/panels"
import "../../../../shared"
import "../../../../shared/controls"
import "../../../../shared/panels"
import utils 1.0
@ -11,7 +11,14 @@ Item {
height: childrenRect.height
width: chatName.width + (ensOrAlias.visible ? ensOrAlias.width + ensOrAlias.anchors.leftMargin : 0)
property alias label: chatName
visible: isMessage && authorCurrentMsg != authorPrevMsg
// property var messageContextMenu
// property bool isCurrentUser: false
// property string userName: ""
// property string localName: ""
// property string displayUserName: ""
signal clickMessage(bool isProfileClick)
//TODO remove dynamic scoping
//visible: isMessage && authorCurrentMsg != authorPrevMsg
StyledTextEdit {
id: chatName
@ -35,11 +42,13 @@ Item {
root.isHovered = false
}
onClicked: {
// Set parent, X & Y positions for the messageContextMenu
messageContextMenu.parent = root
messageContextMenu.setXPosition = function() { return 0}
messageContextMenu.setYPosition = function() { return root.height + 4}
clickMessage(true)
if (!!messageContextMenu) {
// Set parent, X & Y positions for the messageContextMenu
messageContextMenu.parent = root
messageContextMenu.setXPosition = function() { return 0}
messageContextMenu.setYPosition = function() { return root.height + 4}
}
root.clickMessage(true);
}
}
}

View File

@ -0,0 +1,57 @@
import QtQuick 2.3
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/status"
Item {
id: channelBadge
property int realChatType: -1
property string name: "channelName"
property color textColor
property string chatId: ""
property string profileImage: ""
property string identicon
SVGImage {
id: channelIcon
width: 16
height: 16
fillMode: Image.PreserveAspectFit
source: Style.svg("channel-icon-" + (realChatType === Constants.chatTypePublic ? "public-chat" : "group"))
anchors.left: parent.left
anchors.verticalCenter:parent.verticalCenter
}
StatusIdenticon {
id: contactImage
height: 16
width: 16
chatId: chatId
chatName: name
chatType: realChatType
identicon: profileImage || identicon
anchors.left: channelIcon.right
anchors.leftMargin: 4
anchors.verticalCenter: parent.verticalCenter
letterSize: 11
}
StyledText {
id: contactInfo
text: realChatType !== Constants.chatTypePublic ?
Emoji.parse(Utils.removeStatusEns(Utils.filterXSS(name))) :
"#" + Utils.filterXSS(name)
anchors.left: contactImage.right
anchors.leftMargin: 4
color: textColor
font.weight: Font.Medium
font.pixelSize: 13
anchors.verticalCenter: parent.verticalCenter
}
}

View File

@ -0,0 +1,119 @@
import QtQuick 2.3
import QtGraphicalEffects 1.13
import StatusQ.Components 0.1
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/status"
import "../../../../../shared/controls"
Item {
id: communityBadge
property string image: ""
property string iconColor: ""
property bool useLetterIdenticon: !image
property string communityName: ""
property string channelName: ""
property string communityId: ""
property string name: "channelName"
property color textColor
signal communityNameClicked()
signal channelNameClicked()
SVGImage {
id: communityIcon
visible: !hideSecondIcon
width: 16
height: 16
source: Style.svg("communities")
anchors.left: parent.left
anchors.verticalCenter:parent.verticalCenter
ColorOverlay {
anchors.fill: parent
source: parent
color: textColor
}
}
Loader {
id: communityImageLoader
active: true
anchors.left: communityIcon.visible ? communityIcon.right : parent.left
anchors.leftMargin: 2
anchors.verticalCenter: parent.verticalCenter
sourceComponent: communityBadge.useLetterIdenticon ? letterIdenticon :imageIcon
}
Component {
id: imageIcon
RoundedImage {
source: communityBadge.image
noMouseArea: true
noHover: true
width: 16
height: 16
}
}
Component {
id: letterIdenticon
StatusLetterIdenticon {
width: 16
height: 16
letterSize: 12
name: communityBadge.communityName
color: communityBadge.iconColor
}
}
StyledTextEdit {
id: communityName
text: Utils.getLinkStyle(communityBadge.communityName, hoveredLink)
height: 18
readOnly: true
textFormat: Text.RichText
width: implicitWidth > 300 ? 300 : implicitWidth
clip: true
anchors.left: communityImageLoader.right
anchors.leftMargin: 4
color: textColor
font.pixelSize: 13
anchors.verticalCenter: parent.verticalCenter
onLinkActivated: communityNameClicked()
}
SVGImage {
id: caretImage
source: Style.svg("show-category")
width: 16
height: 16
anchors.left: communityName.right
anchors.verticalCenter: parent.verticalCenter
ColorOverlay {
anchors.fill: parent
source: parent
color: textColor
}
}
StyledTextEdit {
id: channelName
text: Utils.getLinkStyle(communityBadge.channelName || name, hoveredLink)
height: 18
readOnly: true
textFormat: Text.RichText
width: implicitWidth > 300 ? 300 : implicitWidth
clip: true
anchors.left: caretImage.right
color: textColor
font.pixelSize: 13
anchors.verticalCenter: parent.verticalCenter
onLinkActivated: channelNameClicked()
}
}

View File

@ -0,0 +1,45 @@
import QtQuick 2.3
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1
import utils 1.0
import "../../../../../shared/panels"
import "../../../../../shared/controls"
Item {
id: replyComponent
property int replyMessageIndex: wrapper.replyMessageIndex
property string repliedMessageContent: wrapper.repliedMessageContent
onReplyMessageIndexChanged: {
wrapper.visible = replyMessageIndex > -1
}
SVGImage {
id: replyIcon
width: 16
height: 16
source: Style.svg("reply-small-arrow")
anchors.left: parent.left
anchors.verticalCenter:parent.verticalCenter
}
StyledTextEdit {
text: Utils.getReplyMessageStyle(Emoji.parse(Utils.linkifyAndXSS(repliedMessageContent), Emoji.size.small), false, appSettings.useCompactMode)
textFormat: Text.RichText
height: 18
width: implicitWidth > 300 ? 300 : implicitWidth
clip: true
anchors.left: replyIcon.right
anchors.leftMargin: 4
color: Style.current.secondaryText
font.weight: Font.Medium
font.pixelSize: 13
anchors.verticalCenter: parent.verticalCenter
selectByMouse: true
readOnly: true
}
}

View File

@ -0,0 +1,79 @@
import QtQuick 2.13
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/status/core"
import utils 1.0
Item {
id: root
height: childrenRect.height + Style.current.smallPadding * 2
anchors.left: parent.left
anchors.right: parent.right
property int nextMessageIndex
property string nextMsgTimestamp
signal clicked()
signal timerTriggered()
Timer {
id: timer
interval: 3000
onTriggered: {
fetchLoaderIndicator.active = false;
fetchMoreButton.visible = true;
fetchDate.visible = true;
root.timerTriggered();
}
}
Separator {
id: sep1
}
Loader {
id: fetchLoaderIndicator
anchors.top: sep1.bottom
anchors.topMargin: Style.current.padding
anchors.left: parent.left
anchors.right: parent.right
active: false
sourceComponent: StatusLoadingIndicator {
width: 12
height: 12
}
}
StyledText {
id: fetchMoreButton
font.weight: Font.Medium
font.pixelSize: Style.current.primaryTextFontSize
color: Style.current.blue
//% " Fetch more messages"
text: qsTrId("load-more-messages")
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: sep1.bottom
anchors.topMargin: Style.current.smallPadding
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
root.clicked();
fetchLoaderIndicator.active = true;
fetchMoreButton.visible = false;
fetchDate.visible = false;
}
}
}
StyledText {
id: fetchDate
anchors.top: fetchMoreButton.bottom
anchors.topMargin: 3
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
color: Style.current.secondaryText
//% "before %1"
text: qsTrId("before--1").arg((nextMessageIndex > -1 ? new Date(nextMsgTimestamp * 1) : new Date()).toLocaleString(Qt.locale(globalSettings.locale)))
}
Separator {
anchors.top: fetchDate.bottom
anchors.topMargin: Style.current.smallPadding
}
}

View File

@ -0,0 +1,52 @@
import QtQuick 2.13
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/status/core"
import utils 1.0
Item {
id: root
height: childrenRect.height + Style.current.smallPadding * 2
anchors.left: parent.left
anchors.right: parent.right
signal clicked()
Separator {
id: sep1
}
StyledText {
id: fetchMoreButton
font.weight: Font.Medium
font.pixelSize: Style.current.primaryTextFontSize
color: Style.current.blue
//% " "
//% "Fetch messages"
text: qsTrId("fetch-messages")
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: sep1.bottom
anchors.topMargin: Style.current.smallPadding
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
root.clicked();
}
}
}
StyledText {
id: fetchDate
anchors.top: fetchMoreButton.bottom
anchors.topMargin: 3
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
color: Style.current.secondaryText
//% "before %1"
//% "Between %1 and %2"
text: qsTrId("between--1-and--2").arg(new Date(root.gapFrom*1000)).arg(new Date(root.gapTo*1000))
}
Separator {
anchors.top: fetchDate.bottom
anchors.topMargin: Style.current.smallPadding
}
}

View File

@ -2,16 +2,29 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/popups"
import "../../../../../shared/panels"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/status"
import ".."
Item {
id: root
width: parent.width
height: 64
property bool allBtnHighlighted: false
property bool repliesBtnHighlighted: false
property bool mentionsBtnHighlighted: false
property alias repliesBtnEnabled: repliesbtn.enabled
property alias mentionsBtnEnabled: mentionsBtn.enabled
property alias errorText: errorText.text
signal allBtnClicked()
signal repliesBtnClicked()
signal mentionsBtnClicked()
signal preferencesClicked()
signal markAllReadClicked()
Row {
id: filterButtons
anchors.verticalCenter: parent.verticalCenter
@ -26,8 +39,10 @@ Item {
text: qsTrId("all")
type: "secondary"
size: "small"
highlighted: activityCenter.currentFilter === ActivityCenter.Filter.All
onClicked: activityCenter.currentFilter = ActivityCenter.Filter.All
highlighted: root.allBtnHighlighted
onClicked: {
root.allBtnClicked();
}
}
StatusButton {
@ -35,21 +50,23 @@ Item {
//% "Mentions"
text: qsTrId("mentions")
type: "secondary"
enabled: hasMentions
size: "small"
highlighted: activityCenter.currentFilter === ActivityCenter.Filter.Mentions
onClicked: activityCenter.currentFilter = ActivityCenter.Filter.Mentions
highlighted: root.mentionsBtnHighlighted
onClicked: {
root.mentionsBtnClicked();
}
}
StatusButton {
id: repliesbtn
//% "Replies"
text: qsTrId("replies")
enabled: hasReplies
type: "secondary"
size: "small"
highlighted: activityCenter.currentFilter === ActivityCenter.Filter.Replies
onClicked: activityCenter.currentFilter = ActivityCenter.Filter.Replies
highlighted: root.repliesBtnHighlighted
onClicked: {
root.repliesBtnClicked();
}
}
// StatusButton {
@ -80,9 +97,7 @@ Item {
icon.height: 24
width: 32
height: 32
onClicked: {
errorText.text = chatsModel.activityNotificationList.markAllActivityCenterNotificationsRead()
}
onClicked: markAllReadClicked()
StatusToolTip {
visible: markAllReadBtn.hovered
@ -119,11 +134,7 @@ Item {
//% "Notification settings"
text: qsTrId("chat-notification-preferences")
onTriggered: {
activityCenter.close()
appMain.changeAppSection(Constants.profile)
// TODO: replace with shared store constant
// Profile/RootStore.notifications_id
profileLayoutContainer.changeProfileSection(7)
root.preferencesClicked();
}
}
}

View File

@ -0,0 +1,90 @@
import QtQuick 2.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/controls"
import "../../../../shared/status"
import "../controls/activityCenter" as ActivityCenter
Rectangle {
id: wrapper
property string name: "channelName"
property string identicon: ""
property string chatId: ""
property int realChatType: -1
property string communityId
property string channelName: ""
property string communityName: ""
property string communityColor: ""
property string communityThumbnailImage: ""
property int replyMessageIndex: -1
property string repliedMessageContent: ""
property int notificationType
property string profileImage: ""
property color textColor: Style.current.textColor
signal communityNameClicked()
signal channelNameClicked()
height: visible ? 24 : 0
width: childrenRect.width + 12
color: Style.current.transparent
border.color: Style.current.borderSecondary
border.width: 1
radius: 11
Loader {
active: true
height: parent.height
anchors.left: parent.left
anchors.leftMargin: 4
sourceComponent: {
switch (wrapper.notificationType) {
case Constants.activityCenterNotificationTypeMention: return wrapper.communityId ? communityBadgeComponent : channelBadgeComponent
case Constants.activityCenterNotificationTypeReply: return replyComponent
default: return wrapper.communityId ? communityBadgeComponent : channelBadgeComponent
}
}
}
ActivityCenter.ReplyComponent {
id: replyComponent
width: childrenRect.width
height: parent.height
replyMessageIndex: wrapper.replyMessageIndex
repliedMessageContent: wrapper.repliedMessageContent
}
ActivityCenter.CommunityBadge {
id: communityBadgeComponent
width: childrenRect.width
height: parent.height
textColor: wrapper.textColor
image: wrapper.communityThumbnailImage
iconColor: wrapper.communityColor
communityName: wrapper.communityName
channelName: wrapper.channelName
name: wrapper.name
onCommunityNameClicked: communityNameClicked()
onChannelNameClicked: channelNameClicked()
}
ActivityCenter.ChannelBadge {
id: channelBadgeComponent
width: childrenRect.width
height: parent.height
realChatType: wrapper.realChatType
textColor: wrapper.textColor
name: wrapper.name
chatId: wrapper.chatId
profileImage: wrapper.profileImage
identicon: wrapper.identicon
}
}

View File

@ -1,7 +1,7 @@
import QtQuick 2.3
import QtMultimedia 5.14
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../shared"
import "../../../../shared/panels"
import utils 1.0

View File

@ -1,19 +1,23 @@
import QtQuick 2.13
import QtGraphicalEffects 1.13
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status"
import utils 1.0
Rectangle {
id: buttonsContainer
property bool parentIsHovered: false
property bool showEdit: true
signal hoverChanged(bool hovered)
property int containerMargin: 2
property int contentType: 2
property var messageContextMenu
property bool showMoreButton: true
property bool activityCenterMessage
property string fromAuthor
property alias editBtnActive: editBtn.active
signal hoverChanged(bool hovered)
signal setMessageActive(string messageId, bool active)
signal clickMessage(bool isProfileClick, bool isSticker, bool isImage, var image, bool emojiOnly)
visible: !activityCenterMessage &&
(buttonsContainer.parentIsHovered || isMessageActive)
@ -108,7 +112,6 @@ Rectangle {
Loader {
id: editBtn
active: isText && !isEdit && isCurrentUser && showEdit
sourceComponent: StatusIconButton {
id: btn
icon.name: "edit-message"

View File

@ -1,32 +1,49 @@
import QtQuick 2.14
import QtQuick.Shapes 1.13
import QtGraphicalEffects 1.13
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/controls"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/controls"
import "../../../../shared/status"
import "../controls"
import utils 1.0
Loader {
id: root
property int nameMargin: 6
// property bool isCurrentUser: false
property int textFieldWidth: item ? item.textField.width : 0
property int textFieldImplicitWidth: 0
property int authorWidth: item ? item.authorMetrics.width : 0
// property int repliedMessageType
// property string repliedMessageImage
// property string repliedMessageUserIdenticon
// property bool repliedMessageIsEdited
// property string repliedMessageUserImage
// property string repliedMessageAuthor
// property string repliedMessageContent
property bool longReply: false
property color elementsColor: isCurrentUser ? Style.current.chatReplyCurrentUser : Style.current.secondaryText
property var container
property int chatHorizontalPadding
// property string responseTo: ""
property var stickerData
property int nameMargin: 6
id: root
active: responseTo !== "" && replyMessageIndex > -1 && !activityCenterMessage
// signal scrollToBottom(bool isit, var container)
signal clickMessage(bool isProfileClick, bool isSticker, bool isImage, var image, bool emojiOnly, bool hideEmojiPicker, bool isReply)
sourceComponent: Component {
Item {
property alias textField: lblReplyMessage
property alias authorMetrics: txtAuthorMetrics
property var messageEdited: function(id, content) {
if (responseTo === id){
lblReplyMessage.text = Utils.getReplyMessageStyle(Emoji.parse(Utils.linkifyAndXSS(content + Constants.editLabel), Emoji.size.small), isCurrentUser, appSettings.useCompactMode)
}
}
id: chatReply
// childrenRect.height shows a binding loop for some reason, so we use heights instead
@ -90,17 +107,12 @@ Loader {
active: true
anchors.left: replyCorner.right
anchors.leftMargin: Style.current.halfPadding
identiconImageSource: repliedMessageUserIdenticon
// identiconImageSource: repliedMessageUserIdenticon
isReplyImage: true
profileImage: repliedMessageUserImage
}
Connections {
target: chatsModel.messageView
onMessageEdited: {
if (responseTo === editedMessageId){
lblReplyMessage.text = Utils.getReplyMessageStyle(Emoji.parse(Utils.linkifyAndXSS(editedMessageContent + Constants.editLabel), Emoji.size.small), isCurrentUser, appSettings.useCompactMode)
}
// profileImage: repliedMessageUserImage
// isCurrentUser: isCurrentUser
onClickMessage: {
root.clickMessage(true, false, false, null, false, false, isReplyImage)
}
}
@ -141,7 +153,7 @@ Loader {
id: stickerId
imageHeight: 56
imageWidth: 56
stickerData: chatsModel.messageView.messageList.getMessageData(replyMessageIndex, "sticker")
stickerData: root.stickerData
contentType: repliedMessageType
onLoaded: {
scrollToBottom(true, root.container)

View File

@ -1,15 +1,16 @@
import QtQuick 2.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/status"
Item {
visible: chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne && (!isContact /*|| !contactRequestReceived*/)
width: parent.width
height: childrenRect.height
signal addContactClicked()
Image {
id: waveImg
source: Style.png("wave")
@ -54,6 +55,6 @@ Item {
anchors.top: contactText2.bottom
anchors.topMargin: Style.current.smallPadding
anchors.horizontalCenter: parent.horizontalCenter
onClicked: profileModel.contacts.addContact(activeChatId)
onClicked: addContactClicked()
}
}

View File

@ -2,7 +2,6 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import "../components"
import "../../../../shared"
import "../../../../shared/panels"
@ -28,9 +27,3 @@ Item {
color: Style.current.darkGrey
}
}
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";formeditorZoom:1.25;height:500;width:300}
}
##^##*/

View File

@ -4,6 +4,8 @@ import QtQuick.Controls 2.3
import utils 1.0
import "../../../../shared"
import "../controls"
ScrollView {
property alias membersData: membersData
property string searchString

View File

@ -14,6 +14,8 @@ Rectangle {
property string localNickname
property var profileClick: function() {}
signal blockContactActionTriggered(name: string, address: string)
signal acceptClicked()
signal declineClicked()
property bool isHovered: false
id: container
@ -49,17 +51,14 @@ Rectangle {
onHoveredChanged: container.isHovered = hovered
}
AcceptRejectOptionsButtons {
AcceptRejectOptionsButtonsPanel {
id: buttons
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter
onAcceptClicked: {
chatsModel.channelView.joinPrivateChat(container.address, "")
profileModel.contacts.addContact(container.address)
}
onDeclineClicked: profileModel.contacts.rejectContactRequest(container.address)
onProfileClicked: profileClick(true, name, address, identicon, "", localNickname)
onAcceptClicked: container.acceptClicked()
onDeclineClicked: container.declineClicked()
onProfileClicked: container.profileClick(true, name, address, identicon, "", localNickname)
onBlockClicked: container.blockContactActionTriggered(name, address)
}
}

View File

@ -1,10 +1,10 @@
import QtQuick 2.3
import QtQuick.Controls 2.13
import QtGraphicalEffects 1.13
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/status"
import utils 1.0
Item {
@ -13,48 +13,13 @@ Item {
width: childrenRect.width
property int imageMargin: 4
signal hoverChanged(bool hovered)
// property bool isCurrentUser
// property var emojiReactionsModel
// property bool isMessageActive
signal addEmojiClicked()
function lastTwoItems(nodes) {
//% " and "
return nodes.join(qsTrId("-and-"));
}
function showReactionAuthors(fromAccounts, emojiId) {
let tooltip
if (fromAccounts.length === 1) {
tooltip = fromAccounts[0]
} else if (fromAccounts.length === 2) {
tooltip = lastTwoItems(fromAccounts);
} else {
var leftNode = [];
var rightNode = [];
const maxReactions = 12
let maximum = Math.min(maxReactions, fromAccounts.length)
if (fromAccounts.length > maxReactions) {
leftNode = fromAccounts.slice(0, maxReactions);
rightNode = fromAccounts.slice(maxReactions, fromAccounts.length);
return (rightNode.length === 1) ?
lastTwoItems([leftNode.join(", "), rightNode[0]]) :
//% "%1 more"
lastTwoItems([leftNode.join(", "), qsTrId("-1-more").arg(rightNode.length)]);
}
leftNode = fromAccounts.slice(0, maximum - 1);
rightNode = fromAccounts.slice(maximum - 1, fromAccounts.length);
tooltip = lastTwoItems([leftNode.join(", "), rightNode[0]])
}
//% " reacted with "
tooltip += qsTrId("-reacted-with-");
let emojiHtml = Emoji.getEmojiFromId(emojiId);
if (emojiHtml) {
tooltip += emojiHtml;
}
return tooltip
}
signal hoverChanged(bool hovered)
signal toggleReaction(int emojiID)
signal setMessageActive(string messageId, bool active)
Row {
spacing: root.imageMargin
@ -172,8 +137,7 @@ Item {
emojiContainer.isHovered = false
}
onClicked: {
chatsModel.toggleReaction(messageId, modelData.emojiId)
toggleReaction(modelData.emojiId)
}
}
}
@ -210,7 +174,7 @@ Item {
onExited: addEmojiBtn.isHovered = false
onClicked: {
if (typeof isMessageActive !== "undefined") {
setMessageActive(messageId, true)
setMessageActive(messageId, true);
}
root.addEmojiClicked();
}

View File

@ -6,13 +6,15 @@ import "../../../../shared/popups"
import "../../../../shared/panels"
import utils 1.0
import "../components"
Item {
id: element
Layout.fillHeight: true
Layout.fillWidth: true
signal shareChatKeyClicked()
Image {
id: walkieTalkieImage
anchors.horizontalCenter: parent.horizontalCenter
@ -44,9 +46,7 @@ Item {
onExited: {
parent.font.underline = false
}
onClicked: {
openProfilePopup(profileModel.profile.username, profileModel.profile.pubKey, profileModel.profile.thumbnailImage);
}
onClicked: shareChatKeyClicked()
}
}
@ -101,8 +101,3 @@ Item {
id: inviteFriendsPopup
}
}
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";formeditorZoom:2;height:480;width:640}
}
##^##*/

View File

@ -2,8 +2,7 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import "../components"
import "../data/channelList.js" as ChannelJSON
import "../helpers/channelList.js" as ChannelJSON
import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/panels"
@ -16,6 +15,8 @@ Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
signal suggestedMessageClicked(string channel)
height: suggestionContainer.height + inviteFriendsContainer.height + Style.current.padding * 2
border.color: Style.current.secondaryMenuBorder
radius: 16
@ -138,15 +139,10 @@ Rectangle {
anchors.topMargin: Style.current.smallPadding
width: parent.width
SuggestedChannels {
SuggestedChannelsPanel {
id: sectionRepeater
onSuggestedMessageClicked: emptyView.suggestedMessageClicked(channel)
}
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";formeditorZoom:1.25;height:500;width:300}
}
##^##*/

View File

@ -1,6 +1,7 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status"
@ -8,6 +9,8 @@ import "../../../../shared/status"
import utils 1.0
// TODO: replace with StatusPopupmenu
//Todo Unsed?
PopupMenu {
//% "Fetch Messages"
title: qsTrId("fetch-messages")

View File

@ -1,12 +1,12 @@
import QtQuick 2.3
import QtQuick.Dialogs 1.3
import "../../../../../shared"
import "../../../../../shared/popups"
import "../../../../../shared/panels"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/status"
import utils 1.0
import "./TransactionComponents"
Item {
property string communityId

View File

@ -12,7 +12,7 @@ import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/status"
import "./"
import "../controls"
StatusPopupMenu {
id: messageContextMenu
@ -92,12 +92,13 @@ StatusPopupMenu {
bottomPadding: messageContextMenu.emojiOnly ? 0 : Style.current.padding
Repeater {
model: reactionModel
model: messageContextMenu.reactionModel
delegate: EmojiReaction {
source: Style.svg(filename)
emojiId: model.emojiId
reactedByUser: !!messageContextMenu.emojiReactionsReactedByUser[model.emojiId]
closeModal: function () {
onCloseModal: {
chatsModel.toggleReaction(SelectedMessage.messageId, emojiId)
messageContextMenu.close()
}
}

View File

@ -1,20 +1,39 @@
import QtQuick 2.3
import QtGraphicalEffects 1.13
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/status"
import utils 1.0
import "../../../../../shared/status"
import "../controls"
//TODO remove this or make view
import "../views"
MouseArea {
id: root
property var clickMessage: function () {}
property bool hovered: containsMouse
property var container
property int statusAgeEpoch: 0
property var messageContextMenu
// property var emojiReactionsModel
// property string timestamp: ""
// property bool isCurrentUser: false
// property bool isMessageActive: false
// property string userName: ""
// property string localName: ""
// property string displayUserName: ""
// property bool isImage: false
// property bool isMessage: false
// property string profileImageSource: ""
// property string userIdenticon: ""
signal userNameClicked(bool isProfileClick)
signal setMessageActive(string messageId, bool active)
signal emojiBtnClicked(bool isProfileClick, bool isSticker, bool isImage, var image, bool emojiOnly)
signal clickMessage(bool isProfileClick, bool isSticker, bool isImage, var image, bool emojiOnly, bool hideEmojiPicker, bool isReply)
anchors.top: parent.top
anchors.topMargin: 0
height: (isImage ? chatImageContent.height : chatText.height) + chatName.height + 2* Style.current.padding + (emojiReactionsModel.length ? 20 : 0)
@ -23,6 +42,7 @@ MouseArea {
cursorShape: Qt.PointingHandCursor
propagateComposedEvents: true
signal chatImageClicked(string image)
signal addEmoji(bool isProfileClick, bool isSticker, bool isImage , var image, bool emojiOnly, bool hideEmojiPicker)
onClicked: {
@ -42,19 +62,34 @@ MouseArea {
anchors.leftMargin: Style.current.padding
anchors.top: parent.top
anchors.topMargin: Style.current.halfPadding
// messageContextMenu: root.messageContextMenu
// profileImage: root.profileImageSource
// isMessage: root.isMessage
// identiconImageSource: root.userIdenticon
onClickMessage: {
root.clickMessage(true, false, false, null, false, false, isReplyImage)
}
}
UsernameLabel {
id: chatName
z: 51
visible: chatImage.visible
anchors.leftMargin: Style.current.halfPadding
anchors.top: chatImage.top
anchors.left: chatImage.right
label.font.pixelSize: Style.current.primaryTextFontSize
z: 51
// messageContextMenu: root.messageContextMenu
// isCurrentUser: root.isCurrentUser
// userName: root.userName
// localName: root.localName
// displayUserName: root.displayUserName
onClickMessage: {
root.userNameClicked(true);
}
}
ChatTime {
ChatTimeView {
id: chatTime
// statusAgeEpoch is used to trigger Qt property update
// since the returned string will be the same in 99% cases, this should not trigger ChatTime re-rendering
@ -63,9 +98,10 @@ MouseArea {
anchors.verticalCenter: chatName.verticalCenter
anchors.left: chatName.right
anchors.leftMargin: Style.current.halfPadding
timestamp: root.timestamp
}
ChatText {
ChatTextView {
id: chatText
anchors.top: chatName.visible ? chatName.bottom : chatImage.top
anchors.topMargin: chatName.visible ? 6 : 0
@ -87,8 +123,10 @@ MouseArea {
StatusChatImage {
imageSource: image
imageWidth: 200
onClicked: imageClick(image)
container: root.container
onClicked: {
root.chatImageClicked(image);
}
}
}
}
@ -111,7 +149,7 @@ MouseArea {
messageContextMenu.parent = emojiBtn
messageContextMenu.setXPosition = function() { return -messageContextMenu.width + emojiBtn.width}
messageContextMenu.setYPosition = function() { return -messageContextMenu.height - 4}
root.clickMessage(false, false, false, null, true)
root.emojiBtnClicked(false, false, false, null, true)
}
}
@ -137,7 +175,9 @@ MouseArea {
Component {
id: emojiReactionsComponent
EmojiReactions {
EmojiReactionsPanel {
// isMessageActive: root.isMessageActive
// emojiReactionsModel: root.emojiReactionsModel
onAddEmojiClicked: {
root.addEmoji(false, false, false, null, true, false);
// Set parent, X & Y positions for the messageContextMenu
@ -145,6 +185,11 @@ MouseArea {
messageContextMenu.setXPosition = function() { return (messageContextMenu.parent.x + 4)}
messageContextMenu.setYPosition = function() { return (-messageContextMenu.height - 4)}
}
onToggleReaction: chatsModel.toggleReaction(messageId, emojiID)
// onSetMessageActive: {
// root.setMessageActive(messageId, active);;
// }
}
}

View File

@ -5,12 +5,14 @@ import QtQuick.Layouts 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/panels"
import "../data/channelList.js" as ChannelJSON
import "./"
import "../helpers/channelList.js" as ChannelJSON
import "../controls"
Repeater {
id: sectionRepeater
model: ChannelJSON.categories
signal suggestedMessageClicked(string channel)
Item {
anchors.top: index === 0 ? parent.top : parent.children[index - 1].bottom
anchors.topMargin: index === 0 ? 0 : Style.current.padding
@ -32,14 +34,13 @@ Repeater {
spacing: 10
Repeater {
model: modelData.channels
SuggestedChannel { channel: modelData }
SuggestedChannel {
channel: modelData
onClicked: {
suggestedMessageClicked(channel);
}
}
}
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -104,7 +104,7 @@ Rectangle {
color: "#22000000"
}
SuggestionFilter {
SuggestionFilterPanel {
id: filterItem
sourceModel: container.model
cursorPosition: container.cursorPosition

View File

@ -1,6 +1,5 @@
import QtQuick 2.13
Item {
id: component
property alias model: filterModel

View File

@ -1,9 +1,11 @@
import QtQuick 2.3
import "../../../../../shared"
import "../../../../../shared/panels"
import utils 1.0
import "./TransactionComponents"
import "../../../../shared"
import "../../../../shared/panels"
import "../controls"
//TODO remove or make view
import "../views"
Item {
property var commandParametersObject: {
@ -25,7 +27,11 @@ Item {
}
}
}
property var focusedAccount
property string activeChannelName
property string activeChannelIdenticon
signal getGasPrice()
signal sendTransactionClicked(string fromAddress)
property var token: JSON.parse(commandParametersObject.contract) // TODO: handle {}
property string tokenAmount: commandParametersObject.value
property string tokenSymbol: token.symbol || ""
@ -176,7 +182,7 @@ Item {
Component {
id: acceptTransactionComponent
AcceptTransaction {
AcceptTransactionView {
state: root.state
}
}
@ -186,6 +192,25 @@ Item {
SendTransactionButton {
// outgoing: root.outgoing
acc: root.focusedAccount
selectedAsset: token
selectedAmount: tokenAmount
selectedFiatAmount: fiatValue
fromAddress: commandParametersObject.fromAddress
selectedRecipient: {
return {
address: commandParametersObject.address,
identicon: root.activeChannelIdenticon,
name: root.activeChannelName,
type: RecipientSelector.Type.Contact
}
}
onSignModalOpened: {
root.getGasPrice();
}
onSendTransaction: {
root.sendTransactionClicked(address);
}
}
}

View File

@ -10,17 +10,18 @@ import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/status"
import "../controls"
import utils 1.0
import "../components"
import "./samples/"
import "./MessageComponents"
import "../ContactsColumn"
Item {
id: root
anchors.fill: parent
property var userList
property var currentTime
property bool isOnline
property var contactsList
property string profilePubKey
property var messageContextMenu
StyledText {
@ -63,12 +64,15 @@ Item {
}
]
model: root.userList
delegate: User {
delegate: UserDelegate {
publicKey: model.publicKey
name: model.userName
identicon: model.identicon
lastSeen: model.lastSeen / 1000
currentTime: root.currentTime
isOnline: root.isOnline
contactsList: root.contactsList
profilePubKey: root.profilePubKey
}
}
}

View File

@ -1,11 +1,11 @@
import QtQuick 2.13
import QtGraphicalEffects 1.13
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/status"
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/status"
import utils 1.0
import "."
import "../../popups/community"
Rectangle {
id: root

View File

@ -5,11 +5,10 @@ import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/controls"
import "../../../../shared/panels"
import "../../../../shared/status"
import "../../../../../shared"
import "../../../../../shared/controls"
import "../../../../../shared/panels"
import "../../../../../shared/status"
import StatusQ.Components 0.1
import StatusQ.Popups 0.1

View File

@ -8,10 +8,11 @@ import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
import utils 1.0
import "../../../../shared"
import "../components"
import "../../../../../shared"
import "../../popups"
import "../../popups/community"
Item {
id: root

View File

@ -6,15 +6,13 @@ import QtQuick.Layouts 1.13
import QtQml.Models 2.13
import QtGraphicalEffects 1.13
import QtQuick.Dialogs 1.3
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/status"
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/status"
import utils 1.0
import "../components"
import "../ChatColumn/MessageComponents"
import "../ChatColumn/"
import "../ContactsColumn"
import "../../controls"
import StatusQ.Core.Theme 0.1
@ -23,6 +21,8 @@ Item {
anchors.fill: parent
property var userList
property var currentTime
property var contactsList
property string profilePubKey
property var messageContextMenu
property QtObject community: chatsModel.communities.activeCommunity
@ -84,7 +84,7 @@ Item {
}
]
model: community.members
delegate: User {
delegate: UserDelegate {
publicKey: model.pubKey
name: model.userName
identicon: model.identicon
@ -92,6 +92,9 @@ Item {
statusType: model.statusType
currentTime: root.currentTime
isOnline: model.online
contactsList: root.contactsList
profilePubKey: root.profilePubKey
messageContextMenu: root.messageContextMenu
}
}
}

View File

@ -1,9 +1,10 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtGraphicalEffects 1.13
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/status"
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/status"
import utils 1.0
import "."

View File

@ -4,11 +4,10 @@ import QtQml.Models 2.13
import QtGraphicalEffects 1.13
import "../../../../shared"
import "../../../../shared/status"
import "../views"
import "../panels"
import utils 1.0
import "./ChatComponents"
import "../components"
import "./MessageComponents"
Popup {
enum Filter {
@ -17,12 +16,13 @@ Popup {
Replies,
ContactRequests
}
property int currentFilter: ActivityCenter.Filter.All
property int currentFilter: ActivityCenterPopup.Filter.All
property bool hasMentions: false
property bool hasReplies: false
// property bool hasContactRequests: false
property bool hideReadNotifications: false
property var store
id: activityCenter
modal: false
@ -56,8 +56,32 @@ Popup {
}
padding: 0
ActivityCenterTopBar {
ActivityCenterPopupTopBarPanel {
id: activityCenterTopBar
repliesBtnEnabled: hasReplies
mentionsBtnEnabled: hasMentions
allBtnHighlighted: activityCenter.currentFilter === ActivityCenterPopup.Filter.All
mentionsBtnHighlighted: activityCenter.currentFilter === ActivityCenterPopup.Filter.Mentions
repliesBtnHighlighted: activityCenter.currentFilter === ActivityCenterPopup.Filter.Replies
onAllBtnClicked: {
activityCenter.currentFilter = ActivityCenterPopup.Filter.All;
}
onRepliesBtnClicked: {
activityCenter.currentFilter = ActivityCenterPopup.Filter.Replies;
}
onMentionsBtnClicked: {
activityCenter.currentFilter = ActivityCenterPopup.Filter.Mentions;
}
onPreferencesClicked: {
activityCenter.close()
appMain.changeAppSection(Constants.profile)
// TODO: replace with shared store constant
// Profile/RootStore.notifications_id
profileLayoutContainer.changeProfileSection(7)
}
onMarkAllReadClicked: {
errorText = chatsModel.activityNotificationList.markAllActivityCenterNotificationsRead()
}
}
ScrollView {
@ -158,7 +182,9 @@ Popup {
return -1;
}
property string previousNotificationTimestamp: notificationDelegate.idx === 0 ? "" : chatsModel.activityNotificationList.getNotificationData(previousNotificationIndex, "timestamp")
onPreviousNotificationTimestampChanged: {
activityCenter.store.messageStore.prevMsgTimestamp = previousNotificationTimestamp;
}
id: notifLoader
anchors.top: parent.top
@ -178,13 +204,17 @@ Popup {
Component {
id: messageNotificationComponent
ActivityCenterMessageComponent {}
ActivityCenterMessageComponentView {
store: activityCenter.store
}
}
Component {
id: groupRequestNotificationComponent
ActivityCenterGroupRequest {}
ActivityCenterGroupRequest {
timestamp: activityCenter.store.messageStore.timestamp
}
}
}
}

View File

@ -4,13 +4,12 @@ import QtQuick.Layouts 1.13
import QtQuick.Dialogs 1.3
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/controls"
import "../../../../../shared/popups"
import "../../../../../shared/views"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/controls"
import "../../../../shared/popups"
import "../../../../shared/views"
import "../../../../shared/status"
// TODO: replace with StatusModal
ModalPopup {
property string commandTitle: "Send"

View File

@ -8,6 +8,9 @@ import "../../../../shared"
import "../../../../shared/status"
import "../../../../shared/popups"
import "../../Profile/Sections/Contacts"
import "../panels"
// TODO: Replace with StatusModal
ModalPopup {
id: popup
@ -31,7 +34,7 @@ ModalPopup {
model: profileModel.contacts.contactRequests
clip: true
delegate: ContactRequest {
delegate: ContactRequestPanel {
name: Utils.removeStatusEns(model.name)
address: model.address
localNickname: model.localNickname
@ -45,6 +48,13 @@ ModalPopup {
blockContactConfirmationDialog.contactAddress = address
blockContactConfirmationDialog.open()
}
onAcceptClicked: {
chatsModel.channelView.joinPrivateChat(model.address, "")
profileModel.contacts.addContact(model.address)
}
onDeclineClicked: {
profileModel.contacts.rejectContactRequest(model.address)
}
}
}

View File

@ -10,7 +10,8 @@ import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/views"
import "../../../../shared/status"
import "./"
import "../panels"
import "../controls"
// TODO: replace with StatusModal
ModalPopup {
@ -129,7 +130,7 @@ ModalPopup {
anchors.horizontalCenter: parent.horizontalCenter
}
ContactList {
ContactListPanel {
id: contactList
searchString: searchBox.text.toLowerCase()
selectMode: selectChatMembers && memberCount < maxMembers

View File

@ -12,7 +12,7 @@ import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/controls"
import "../../../../shared/status"
import "./"
import "../panels"
// TODO: replace with StatusModal
ModalPopup {
@ -185,7 +185,7 @@ ModalPopup {
anchors.horizontalCenter: parent.horizontalCenter
}
ContactList {
ContactListPanel {
id: contactList
visible: addMembers && contactList.membersData.count > 0
anchors.fill: parent

View File

@ -6,11 +6,16 @@ import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/status"
import "../data"
import "../ChatColumn"
import "../controls"
import "../panels"
//TODO remove or make view?
import "../views"
// TODO: replace with StatusMOdal
ModalPopup {
property var rootStore
property var messageStore
property bool userCanPin: {
switch (chatsModel.channelView.activeChannel.chatType) {
case Constants.chatTypePublic: return false
@ -107,12 +112,16 @@ ModalPopup {
}
delegate: Item {
id: messageDelegate
property var listView: ListView.view
width: parent.width
height: messageItem.height
Message {
MessageView {
id: messageItem
rootStore: popup.rootStore
messageStore: popup.messageStore
/////////////TODO Remove
fromAuthor: model.fromAuthor
chatId: model.chatId
userName: model.userName
@ -141,12 +150,45 @@ ModalPopup {
activityCenterMessage: false
isEdited: model.isEdited
showEdit: false
messageContextMenu: MessageContextMenu {
messageContextMenu: msgContextMenu
Component.onCompleted: {
messageStore.fromAuthor = model.fromAuthor;
messageStore.chatId = model.chatId;
messageStore.userName = model.userName;
messageStore.alias = model.alias;
messageStore.localName = model.localName;
messageStore.message = model.message;
messageStore.plainText = model.plainText;
messageStore.identicon = model.identicon;
messageStore.isCurrentUser = model.isCurrentUser;
messageStore.timestamp = model.timestamp;
messageStore.sticker = model.sticker;
messageStore.contentType = model.contentType;
messageStore.outgoingStatus = model.outgoingStatus;
messageStore.responseTo = model.responseTo;
messageStore.imageClick = imagePopup.openPopup.bind(imagePopup);
messageStore.messageId = model.messageId;
messageStore.emojiReactions = model.emojiReactions;
messageStore.linkUrls = model.linkUrls;
messageStore.communityId = model.communityId;
messageStore.hasMention = model.hasMention;
messageStore.stickerPackId = model.stickerPackId;
messageStore.timeout = model.timeout;
messageStore.pinnedMessage = true;
messageStore.pinnedBy = model.pinnedBy;
messageStore.forceHoverHandler = !messageToPin;
messageStore.activityCenterMessage = false;
messageStore.isEdited = model.isEdited;
messageStore.showEdit = false;
messageStore.messageContextMenu = msgContextMenu;
}
MessageContextMenuPanel {
id: msgContextMenu
pinnedPopup: true
pinnedMessage: true
reactionModel: EmojiReactions {}
reactionModel: popup.rootStore.emojiReactionsModel
onShouldCloseParentPopup: {
listView.closePopup()
messageDelegate.listView.closePopup();
}
}
}

View File

@ -8,8 +8,8 @@ import "../../../../shared/controls"
import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/status"
import "../data/channelList.js" as ChannelJSON
import "./"
import "../helpers/channelList.js" as ChannelJSON
import "../panels"
// TODO: replace with StatusModal
ModalPopup {
@ -96,9 +96,12 @@ ModalPopup {
return totalHeight + Style.current.padding
}
SuggestedChannels {
SuggestedChannelsPanel {
id: sectionRepeater
width: parent.width
onSuggestedMessageClicked: {
chatsModel.channelView.joinPublicChat(channel);
}
}
}

View File

@ -4,10 +4,10 @@ import QtQuick.Layouts 1.13
import QtQuick.Dialogs 1.3
import utils 1.0
import "../../../../../../shared"
import "../../../../../../shared/controls"
import "../../../../../../shared/popups"
import "../../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/controls"
import "../../../../shared/popups"
import "../../../../shared/status"
// TODO: replace with StatusModal
ModalPopup {

View File

@ -4,12 +4,13 @@ import QtQuick.Layouts 1.13
import QtQuick.Dialogs 1.3
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../../shared/panels"
import "../../../../../shared/controls"
import "../../../../../shared/views"
import "../../../../../shared/popups"
import "../../../../shared"
import "../../../../shared/status"
import "../../../../shared/panels"
import "../../../../shared/controls"
import "../../../../shared/views"
import "../../../../shared/popups"
import "../../Wallet/"
// TODO: replace with StatusModal
ModalPopup {

View File

@ -4,11 +4,11 @@ import QtGraphicalEffects 1.13
import QtQuick.Dialogs 1.3
import utils 1.0
import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/controls"
import "../../../../shared/panels"
import "../../../../shared/status"
import "../../../../../shared"
import "../../../../../shared/popups"
import "../../../../../shared/controls"
import "../../../../../shared/panels"
import "../../../../../shared/status"
// TODO: replace with StatusModal
ModalPopup {

View File

@ -10,7 +10,7 @@ import StatusQ.Popups 0.1
import utils 1.0
import "../../../../shared"
import "../../../../../shared"
StatusModal {
id: popup

View File

@ -10,7 +10,7 @@ import StatusQ.Popups 0.1
import utils 1.0
import "../../../../shared"
import "../../../../../shared"
StatusModal {
property QtObject community: chatsModel.communities.observedCommunity

View File

@ -7,6 +7,8 @@ import StatusQ.Popups 0.1
import utils 1.0
import "../../panels/communities"
StatusModal {
property var community
@ -38,7 +40,7 @@ StatusModal {
Component {
id: profileOverview
CommunityProfilePopupOverview {
CommunityProfilePopupOverviewPanel {
width: stack.width
headerTitle: popup.community.name
@ -84,7 +86,7 @@ StatusModal {
Component {
id: membersList
CommunityProfilePopupMembersList {
CommunityProfilePopupMembersListPanel {
width: stack.width
//% "Members"
headerTitle: qsTrId("members-label")
@ -96,7 +98,7 @@ StatusModal {
Component {
id: inviteFriendsView
CommunityProfilePopupInviteFriendsView {
CommunityProfilePopupInviteFriendsPanel {
width: stack.width
//% "Invite friends"
headerTitle: qsTrId("invite-friends")

View File

@ -3,8 +3,8 @@ import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import utils 1.0
import "../../../../shared"
import "../../../../shared/popups"
import "../../../../../shared"
import "../../../../../shared/popups"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1

View File

@ -4,9 +4,9 @@ import QtGraphicalEffects 1.13
import QtQuick.Dialogs 1.3
import utils 1.0
import "../../../../shared"
import "../../../../shared/panels"
import "../../../../shared/popups"
import "../../../../../shared"
import "../../../../../shared/panels"
import "../../../../../shared/popups"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1

View File

@ -9,8 +9,10 @@ import StatusQ.Popups 0.1
import utils 1.0
import "../../../../shared"
import "../components"
import "../../../../../shared"
import "../../views"
import "../../panels/communities"
StatusModal {
id: popup
@ -32,7 +34,7 @@ StatusModal {
//% "Invite friends"
header.title: qsTrId("invite-friends")
contentItem: CommunityProfilePopupInviteFriendsView {
contentItem: CommunityProfilePopupInviteFriendsPanel {
id: contactFieldAndList
contactListSearch.onUserClicked: {
if (isContact) {

View File

@ -9,7 +9,7 @@ import StatusQ.Popups 0.1
import utils 1.0
import "../../../../shared"
import "../../../../../shared"
StatusModal {
id: popup

View File

@ -8,8 +8,8 @@ import StatusQ.Popups 0.1
import utils 1.0
import "../../../../shared"
import "../../../../shared/controls"
import "../../../../../shared"
import "../../../../../shared/controls"
StatusModal {
id: popup

View File

@ -1,4 +0,0 @@
ContactsColumn 1.0 ContactsColumn.qml
ChatColumn 1.0 ChatColumn.qml
SuggestionBox 1.0 SuggestionBox.qml
SuggestionFilter 1.0 SuggestionFilter.qml

View File

@ -0,0 +1,53 @@
import QtQuick 2.13
import utils 1.0
QtObject {
id: root
property var messageStore
property EmojiReactions emojiReactionsModel: EmojiReactions { }
property var chatsModelInst: chatsModel
property var walletModelInst: walletModel
property var profileModelInst: profileModel
function lastTwoItems(nodes) {
//% " and "
return nodes.join(qsTrId("-and-"));
}
function showReactionAuthors(fromAccounts, emojiId) {
let tooltip
if (fromAccounts.length === 1) {
tooltip = fromAccounts[0]
} else if (fromAccounts.length === 2) {
tooltip = lastTwoItems(fromAccounts);
} else {
var leftNode = [];
var rightNode = [];
const maxReactions = 12
let maximum = Math.min(maxReactions, fromAccounts.length)
if (fromAccounts.length > maxReactions) {
leftNode = fromAccounts.slice(0, maxReactions);
rightNode = fromAccounts.slice(maxReactions, fromAccounts.length);
return (rightNode.length === 1) ?
lastTwoItems([leftNode.join(", "), rightNode[0]]) :
//% "%1 more"
lastTwoItems([leftNode.join(", "), qsTrId("-1-more").arg(rightNode.length)]);
}
leftNode = fromAccounts.slice(0, maximum - 1);
rightNode = fromAccounts.slice(maximum - 1, fromAccounts.length);
tooltip = lastTwoItems([leftNode.join(", "), rightNode[0]])
}
//% " reacted with "
tooltip += qsTrId("-reacted-with-");
let emojiHtml = Emoji.getEmojiFromId(emojiId);
if (emojiHtml) {
tooltip += emojiHtml;
}
return tooltip
}
}

View File

@ -1,9 +1,10 @@
import QtQuick 2.3
import "../../ChatComponents"
import "../../../../../../shared"
import "../../../../../../shared/popups"
import "../../../../../../shared/panels"
import "../../../../../../shared/controls"
import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/panels"
import "../../../../shared/controls"
import "../popups"
import utils 1.0

Some files were not shown because too many files have changed in this diff Show More