2022-01-19 22:33:29 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import QtQml.Models 2.2
|
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: messageList
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 15
|
|
|
|
clip: true
|
2022-08-20 00:01:28 +00:00
|
|
|
|
2022-01-19 22:33:29 +00:00
|
|
|
delegate: StatusMessage {
|
|
|
|
id: delegate
|
2022-08-20 00:01:28 +00:00
|
|
|
width: ListView.view.width
|
2022-01-19 22:33:29 +00:00
|
|
|
|
|
|
|
audioMessageInfoText: "Audio Message"
|
|
|
|
cancelButtonText: "Cancel"
|
|
|
|
saveButtonText: "Save"
|
|
|
|
loadingImageText: "Loading image..."
|
|
|
|
errorLoadingImageText: "Error loading the image"
|
|
|
|
resendText: "Resend"
|
|
|
|
pinnedMsgInfoText: "Pinned by"
|
|
|
|
|
2022-08-20 00:01:28 +00:00
|
|
|
timestamp: model.timestamp
|
|
|
|
isAReply: model.isReply
|
|
|
|
hasMention: model.hasMention
|
|
|
|
isPinned: model.isPinned
|
|
|
|
pinnedBy: model.pinnedBy
|
|
|
|
hasExpired: model.hasExpired
|
|
|
|
reactionsModel: model.reactions || []
|
|
|
|
|
2022-01-19 22:33:29 +00:00
|
|
|
messageDetails: StatusMessageDetails {
|
|
|
|
contentType: model.contentType
|
|
|
|
messageContent: model.messageContent
|
|
|
|
amISender: model.amIsender
|
2022-08-20 00:01:28 +00:00
|
|
|
sender.id: model.senderId
|
|
|
|
sender.userName: model.userName
|
|
|
|
sender.localName: model.localName
|
|
|
|
sender.ensName: model.ensName
|
|
|
|
sender.isContact: model.isContact
|
|
|
|
sender.trustIndicator: model.trustIndicator
|
2022-09-02 15:40:30 +00:00
|
|
|
sender.profileImage: StatusProfileImageSettings {
|
2022-01-19 22:33:29 +00:00
|
|
|
width: 40
|
|
|
|
height: 40
|
2022-08-20 00:01:28 +00:00
|
|
|
pubkey: model.senderId
|
2022-09-02 15:40:30 +00:00
|
|
|
name: model.profileImage || ""
|
2022-08-20 00:01:28 +00:00
|
|
|
colorId: 1
|
|
|
|
colorHash: ListModel {
|
|
|
|
ListElement { colorId: 13; segmentLength: 5 }
|
|
|
|
ListElement { colorId: 31; segmentLength: 5 }
|
|
|
|
ListElement { colorId: 10; segmentLength: 1 }
|
|
|
|
ListElement { colorId: 2; segmentLength: 5 }
|
|
|
|
ListElement { colorId: 26; segmentLength: 2 }
|
|
|
|
ListElement { colorId: 19; segmentLength: 4 }
|
|
|
|
ListElement { colorId: 28; segmentLength: 3 }
|
|
|
|
}
|
2022-01-19 22:33:29 +00:00
|
|
|
}
|
2022-08-20 00:01:28 +00:00
|
|
|
|
2022-01-19 22:33:29 +00:00
|
|
|
messageText: model.message
|
|
|
|
}
|
2022-08-20 00:01:28 +00:00
|
|
|
|
2022-01-19 22:33:29 +00:00
|
|
|
replyDetails: StatusMessageDetails {
|
2022-08-20 00:01:28 +00:00
|
|
|
amISender: model.isReply && model.replyAmISender
|
|
|
|
sender.id: model.replySenderId || ""
|
|
|
|
sender.userName: model.isReply ? model.replySenderName: ""
|
|
|
|
sender.ensName: model.isReply ? model.replySenderEnsName : ""
|
2022-09-02 15:40:30 +00:00
|
|
|
sender.profileImage: StatusProfileImageSettings {
|
2022-01-19 22:33:29 +00:00
|
|
|
width: 20
|
|
|
|
height: 20
|
2022-09-02 15:40:30 +00:00
|
|
|
name: model.isReply ? model.replyProfileImage: ""
|
2022-08-20 00:01:28 +00:00
|
|
|
pubkey: model.replySenderId
|
|
|
|
colorId: 1
|
|
|
|
colorHash: ListModel {
|
|
|
|
ListElement { colorId: 13; segmentLength: 5 }
|
|
|
|
ListElement { colorId: 31; segmentLength: 5 }
|
|
|
|
ListElement { colorId: 10; segmentLength: 1 }
|
|
|
|
ListElement { colorId: 2; segmentLength: 5 }
|
|
|
|
ListElement { colorId: 26; segmentLength: 2 }
|
|
|
|
ListElement { colorId: 19; segmentLength: 4 }
|
|
|
|
ListElement { colorId: 28; segmentLength: 3 }
|
|
|
|
}
|
2022-01-19 22:33:29 +00:00
|
|
|
}
|
|
|
|
messageText: model.isReply ? model.replyMessageText: ""
|
|
|
|
contentType: model.replyContentType
|
|
|
|
messageContent: model.replyMessageContent
|
|
|
|
}
|
2022-08-20 00:01:28 +00:00
|
|
|
|
2022-01-19 22:33:29 +00:00
|
|
|
quickActions: [
|
|
|
|
StatusFlatRoundButton {
|
|
|
|
id: emojiBtn
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
icon.name: "reaction-b"
|
|
|
|
type: StatusFlatRoundButton.Type.Tertiary
|
|
|
|
tooltip.text: "Add reaction"
|
|
|
|
},
|
|
|
|
StatusFlatRoundButton {
|
|
|
|
id: replyBtn
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
icon.name: "reply"
|
|
|
|
type: StatusFlatRoundButton.Type.Tertiary
|
|
|
|
tooltip.text: "Reply"
|
|
|
|
},
|
|
|
|
StatusFlatRoundButton {
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
icon.name: "tiny/edit"
|
|
|
|
type: StatusFlatRoundButton.Type.Tertiary
|
|
|
|
tooltip.text: "Edit"
|
|
|
|
onClicked: {
|
|
|
|
delegate.editMode = !delegate.editMode
|
|
|
|
}
|
|
|
|
},
|
|
|
|
StatusFlatRoundButton {
|
|
|
|
id: otherBtn
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
icon.name: "more"
|
|
|
|
type: StatusFlatRoundButton.Type.Tertiary
|
|
|
|
tooltip.text: "More"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|