2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2023-01-13 13:32:36 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Utils 0.1 as CoreUtils
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
2023-08-31 21:41:45 +00:00
|
|
|
import StatusQ.Components.private 0.1
|
2023-01-13 13:32:36 +00:00
|
|
|
|
|
|
|
import shared 1.0
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property double timestamp: 0
|
|
|
|
property int maximumLineCount: 5
|
|
|
|
|
|
|
|
property Component messageSubheaderComponent: null
|
|
|
|
property Component messageBadgeComponent: null
|
|
|
|
|
2023-02-17 10:25:48 +00:00
|
|
|
property StatusMessageDetails messageDetails: StatusMessageDetails {}
|
2023-01-13 13:32:36 +00:00
|
|
|
|
|
|
|
signal openProfilePopup()
|
|
|
|
|
|
|
|
spacing: 8
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.preferredWidth: root.messageDetails.sender.profileImage.assetSettings.width
|
|
|
|
Layout.preferredHeight: profileImage.height
|
|
|
|
Layout.alignment: Qt.AlignTop
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
2023-01-13 13:32:36 +00:00
|
|
|
Layout.topMargin: 2
|
|
|
|
|
|
|
|
StatusSmartIdenticon {
|
|
|
|
id: profileImage
|
|
|
|
name: root.messageDetails.sender.displayName
|
|
|
|
asset: root.messageDetails.sender.profileImage.assetSettings
|
|
|
|
ringSettings: root.messageDetails.sender.profileImage.ringSettings
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
|
|
onClicked: root.openProfilePopup()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
spacing: 2
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
StatusMessageHeader {
|
|
|
|
sender: root.messageDetails.sender
|
|
|
|
amISender: root.messageDetails.amISender
|
|
|
|
messageOriginInfo: root.messageDetails.messageOriginInfo
|
2024-02-09 15:45:34 +00:00
|
|
|
tertiaryDetail: sender.isEnsVerified ? "" : Utils.getCompressedPk(sender.id)
|
2023-01-10 11:36:03 +00:00
|
|
|
timestamp: root.timestamp
|
2023-01-13 13:32:36 +00:00
|
|
|
onClicked: root.openProfilePopup()
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
sourceComponent: root.messageSubheaderComponent
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
spacing: 2
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
StatusBaseText {
|
2023-04-17 11:25:03 +00:00
|
|
|
text: root.messageDetails.messageText
|
2023-01-13 13:32:36 +00:00
|
|
|
maximumLineCount: root.maximumLineCount
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
elide: Text.ElideRight
|
|
|
|
font.pixelSize: 15
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2023-01-18 12:02:46 +00:00
|
|
|
Layout.fillWidth: !root.messageBadgeComponent
|
2023-01-13 13:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
sourceComponent: root.messageBadgeComponent
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
2023-01-18 12:02:46 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: !!root.messageBadgeComponent
|
|
|
|
}
|
2023-01-13 13:32:36 +00:00
|
|
|
}
|
2023-08-31 21:41:45 +00:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
active: root.messageDetails.contentType === Constants.messageContentType.imageType
|
|
|
|
visible: active
|
|
|
|
Layout.fillWidth: true
|
|
|
|
sourceComponent: StatusMessageImageAlbum {
|
|
|
|
width: parent.width
|
|
|
|
album: root.messageDetails.albumCount > 0 ? root.messageDetails.album : [root.messageDetails.messageContent]
|
|
|
|
albumCount: root.messageDetails.albumCount || 1
|
|
|
|
imageWidth: 56
|
|
|
|
loadingComponentHeight: 56
|
|
|
|
shapeType: StatusImageMessage.ShapeType.ROUNDED
|
|
|
|
}
|
|
|
|
}
|
2023-01-13 13:32:36 +00:00
|
|
|
}
|
2023-01-12 22:39:46 +00:00
|
|
|
}
|