2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2020-09-29 09:06:57 +00:00
|
|
|
|
2022-10-03 12:16:44 +00:00
|
|
|
import StatusQ.Core 0.1
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-03-07 14:56:05 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2023-04-27 12:35:16 +00:00
|
|
|
import StatusQ.Components.private 0.1
|
2022-03-07 14:56:05 +00:00
|
|
|
|
2020-09-29 09:06:57 +00:00
|
|
|
Rectangle {
|
|
|
|
id: root
|
2022-07-05 10:12:27 +00:00
|
|
|
implicitHeight: (root.contentType === Constants.messageContentType.imageType)
|
2024-10-15 19:26:12 +00:00
|
|
|
? replyToUsername.height + imageThumbnail.height + Theme.padding
|
2022-07-05 10:12:27 +00:00
|
|
|
: (root.contentType === Constants.messageContentType.stickerType)
|
2024-10-15 19:26:12 +00:00
|
|
|
? replyToUsername.height + stickerThumbnail.height + Theme.padding
|
2022-07-05 10:12:27 +00:00
|
|
|
: 50
|
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.baseColor3
|
2020-09-29 09:06:57 +00:00
|
|
|
radius: 16
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
property string userName: ""
|
|
|
|
property string message : ""
|
2021-08-30 12:42:11 +00:00
|
|
|
property string image: ""
|
2021-11-09 16:46:18 +00:00
|
|
|
property string stickerData: ""
|
2022-01-12 12:55:26 +00:00
|
|
|
property string messageId: ""
|
2021-08-30 12:42:11 +00:00
|
|
|
property int contentType: -1
|
2023-04-27 12:35:16 +00:00
|
|
|
property var album: []
|
|
|
|
property int albumCount: 0
|
2020-09-29 09:06:57 +00:00
|
|
|
|
|
|
|
signal closeButtonClicked()
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
color: parent.color
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: parent.height / 2
|
|
|
|
width: 32
|
2024-10-15 19:26:12 +00:00
|
|
|
radius: Theme.radius
|
2020-09-29 09:06:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: replyToUsername
|
|
|
|
text: "↪ " + userName
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.textColor
|
2020-09-29 09:06:57 +00:00
|
|
|
anchors.top: parent.top
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.halfPadding
|
2020-09-29 09:06:57 +00:00
|
|
|
anchors.left: parent.left
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.leftMargin: Theme.smallPadding
|
2020-09-29 09:06:57 +00:00
|
|
|
font.pixelSize: 13
|
|
|
|
font.weight: Font.Medium
|
|
|
|
}
|
|
|
|
|
2021-03-23 18:15:26 +00:00
|
|
|
Rectangle {
|
2020-09-29 09:06:57 +00:00
|
|
|
anchors.left: replyToUsername.left
|
|
|
|
anchors.top: replyToUsername.bottom
|
2021-03-23 18:15:26 +00:00
|
|
|
anchors.topMargin: -3
|
2020-09-29 09:06:57 +00:00
|
|
|
anchors.right: parent.right
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.rightMargin: Theme.padding
|
2020-09-29 09:06:57 +00:00
|
|
|
anchors.bottom: parent.bottom
|
2021-03-23 18:15:26 +00:00
|
|
|
clip: true
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.transparent
|
2021-12-09 12:53:40 +00:00
|
|
|
visible: (root.contentType !== Constants.messageContentType.imageType) && (root.contentType !== Constants.messageContentType.stickerType)
|
2021-03-23 18:15:26 +00:00
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: replyText
|
2022-07-05 10:12:27 +00:00
|
|
|
text: StatusQUtils.Utils.getMessageWithStyle(StatusQUtils.Emoji.parse(StatusQUtils.Utils.linkifyAndXSS(message)), false)
|
2021-03-23 18:15:26 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
elide: Text.ElideRight
|
|
|
|
font.pixelSize: 13
|
|
|
|
font.weight: Font.Normal
|
|
|
|
textFormat: Text.RichText
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.textColor
|
2021-03-23 18:15:26 +00:00
|
|
|
}
|
2020-09-29 09:06:57 +00:00
|
|
|
}
|
|
|
|
|
2023-04-27 12:35:16 +00:00
|
|
|
StatusMessageImageAlbum {
|
2021-08-30 12:42:11 +00:00
|
|
|
id: imageThumbnail
|
|
|
|
anchors.left: replyToUsername.left
|
|
|
|
anchors.top: replyToUsername.bottom
|
|
|
|
anchors.topMargin: 2
|
2023-04-27 12:35:16 +00:00
|
|
|
album: root.albumCount > 0 ? root.album : [root.image]
|
|
|
|
albumCount: root.albumCount > 0 ? root.albumCount : 1
|
|
|
|
imageWidth: 56
|
|
|
|
loadingComponentHeight: 56
|
|
|
|
shapeType: StatusImageMessage.ShapeType.ROUNDED
|
2021-08-30 12:42:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusSticker {
|
|
|
|
id: stickerThumbnail
|
|
|
|
anchors.left: replyToUsername.left
|
|
|
|
anchors.top: replyToUsername.bottom
|
|
|
|
anchors.topMargin: 2
|
|
|
|
imageWidth: 64
|
|
|
|
imageHeight: 64
|
2021-11-09 16:46:18 +00:00
|
|
|
stickerData: root.stickerData
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.transparent
|
2021-08-30 12:42:11 +00:00
|
|
|
contentType: root.contentType
|
|
|
|
}
|
|
|
|
|
2020-09-29 09:06:57 +00:00
|
|
|
RoundButton {
|
|
|
|
id: closeBtn
|
|
|
|
implicitWidth: 20
|
|
|
|
implicitHeight: 20
|
|
|
|
radius: 10
|
|
|
|
padding: 0
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 4
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 4
|
2022-10-03 12:16:44 +00:00
|
|
|
contentItem: StatusIcon {
|
2020-09-29 09:06:57 +00:00
|
|
|
id: iconImg
|
2024-10-15 19:26:12 +00:00
|
|
|
source: Theme.svg("close")
|
|
|
|
color: Theme.palette.textColor
|
2022-10-03 12:16:44 +00:00
|
|
|
sourceSize: Qt.size(width, height)
|
2020-09-29 09:06:57 +00:00
|
|
|
width: closeBtn.width
|
|
|
|
height: closeBtn.height
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
|
|
|
color: "transparent"
|
|
|
|
width: closeBtn.width
|
|
|
|
height: closeBtn.height
|
|
|
|
radius: closeBtn.radius
|
|
|
|
}
|
|
|
|
onClicked: {
|
|
|
|
root.userName = ""
|
|
|
|
root.message = ""
|
2022-01-12 12:55:26 +00:00
|
|
|
root.messageId = ""
|
|
|
|
root.stickerData = ""
|
|
|
|
root.image = ""
|
|
|
|
root.contentType = -1
|
2020-09-29 09:06:57 +00:00
|
|
|
root.closeButtonClicked()
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
onPressed: mouse.accepted = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|