2020-07-15 21:04:14 +00:00
|
|
|
import QtQuick 2.3
|
|
|
|
import "../../../../../shared"
|
|
|
|
import "../../../../../imports"
|
|
|
|
|
|
|
|
Rectangle {
|
2020-07-20 21:26:29 +00:00
|
|
|
property alias textField: lblReplyMessage
|
|
|
|
property bool longReply: false
|
2020-09-22 14:30:49 +00:00
|
|
|
property color elementsColor: isCurrentUser ? Style.current.chatReplyCurrentUser : Style.current.secondaryText
|
2020-07-20 21:26:29 +00:00
|
|
|
|
2020-07-15 21:04:14 +00:00
|
|
|
id: chatReply
|
|
|
|
visible: responseTo != "" && replyMessageIndex > -1
|
|
|
|
// childrenRect.height shows a binding loop for soem reason, so we use heights instead
|
2020-07-20 17:34:20 +00:00
|
|
|
height: this.visible ? lblReplyAuthor.height + ((repliedMessageType === Constants.imageType ? imgReplyImage.height : lblReplyMessage.height) + 5 + 8) : 0
|
2020-09-22 14:30:49 +00:00
|
|
|
color: Style.current.transparent
|
2020-07-15 21:04:14 +00:00
|
|
|
|
|
|
|
StyledTextEdit {
|
|
|
|
id: lblReplyAuthor
|
|
|
|
text: "↳" + repliedMessageAuthor
|
2020-09-22 14:30:49 +00:00
|
|
|
color: chatReply.elementsColor
|
2020-07-15 21:04:14 +00:00
|
|
|
readOnly: true
|
|
|
|
selectByMouse: true
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
}
|
|
|
|
|
2020-07-17 19:44:25 +00:00
|
|
|
ChatImage {
|
|
|
|
id: imgReplyImage
|
|
|
|
visible: repliedMessageType == Constants.imageType
|
|
|
|
imageWidth: 50
|
|
|
|
imageSource: repliedMessageImage
|
|
|
|
anchors.top: lblReplyAuthor.bottom
|
|
|
|
anchors.topMargin: 5
|
|
|
|
anchors.left: parent.left
|
|
|
|
chatHorizontalPadding: 0
|
|
|
|
}
|
|
|
|
|
2020-07-15 21:04:14 +00:00
|
|
|
StyledTextEdit {
|
|
|
|
id: lblReplyMessage
|
2020-07-17 19:44:25 +00:00
|
|
|
visible: repliedMessageType != Constants.imageType
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.top: lblReplyAuthor.bottom
|
|
|
|
anchors.topMargin: 5
|
|
|
|
text: Emoji.parse(Utils.linkifyAndXSS(repliedMessageContent), "26x26");
|
|
|
|
textFormat: Text.RichText
|
2020-09-22 14:30:49 +00:00
|
|
|
color: chatReply.elementsColor
|
2020-07-15 21:04:14 +00:00
|
|
|
readOnly: true
|
|
|
|
selectByMouse: true
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
anchors.left: parent.left
|
2020-07-20 21:26:29 +00:00
|
|
|
anchors.right: chatReply.longReply ? parent.right : undefined
|
2020-07-20 21:59:01 +00:00
|
|
|
z: 51
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
2020-07-17 19:44:25 +00:00
|
|
|
anchors.top: repliedMessageType == Constants.imageType ? imgReplyImage.bottom : lblReplyMessage.bottom
|
|
|
|
anchors.topMargin: repliedMessageType == Constants.imageType ? 15 : 8
|
2020-07-15 21:04:14 +00:00
|
|
|
anchors.left: lblReplyMessage.left
|
|
|
|
anchors.right: lblReplyMessage.right
|
|
|
|
anchors.rightMargin: chatTextItem.chatHorizontalPadding
|
2020-09-22 14:30:49 +00:00
|
|
|
color: chatReply.elementsColor
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
}
|