2020-07-09 17:47:36 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-09-30 12:33:26 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2020-07-09 17:47:36 +00:00
|
|
|
import "../../../../imports"
|
|
|
|
import "../../../../shared"
|
2020-09-30 12:33:26 +00:00
|
|
|
import "../../../../shared/status"
|
2020-07-09 17:47:36 +00:00
|
|
|
import "./"
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
property string userName: "Joseph Joestar"
|
2020-07-10 22:22:39 +00:00
|
|
|
property string message: "Your next line is: this is a Jojo reference"
|
2020-07-09 17:47:36 +00:00
|
|
|
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
|
|
|
|
|
|
|
|
id: replyArea
|
|
|
|
height: 70
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.top: parent.top
|
|
|
|
color: "#00000000"
|
|
|
|
|
2020-07-10 22:22:39 +00:00
|
|
|
function setup(){
|
|
|
|
let replyMessageIndex = chatsModel.messageList.getMessageIndex(SelectedMessage.messageId);
|
|
|
|
if (replyMessageIndex == -1) return;
|
|
|
|
|
2020-07-12 01:03:39 +00:00
|
|
|
userName = chatsModel.messageList.getMessageData(replyMessageIndex, "userName")
|
|
|
|
message = chatsModel.messageList.getMessageData(replyMessageIndex, "message")
|
|
|
|
identicon = chatsModel.messageList.getMessageData(replyMessageIndex, "identicon")
|
2020-07-10 22:22:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function reset(){
|
|
|
|
userName = "";
|
|
|
|
message= "";
|
|
|
|
identicon = "";
|
|
|
|
}
|
|
|
|
|
2020-09-30 12:33:26 +00:00
|
|
|
StatusIconButton {
|
2020-07-09 17:47:36 +00:00
|
|
|
id: closeButton
|
2020-09-30 12:33:26 +00:00
|
|
|
type: "secondary"
|
|
|
|
icon.name: "close"
|
2020-07-09 17:47:36 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.padding
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
anchors.right: parent.right
|
2020-09-30 12:33:26 +00:00
|
|
|
onClicked: {
|
|
|
|
chatColumn.hideExtendedArea()
|
2020-07-09 17:47:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: chatImage
|
|
|
|
width: 36
|
|
|
|
height: 36
|
|
|
|
anchors.topMargin: 20
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.top: parent.top
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
source: identicon
|
|
|
|
mipmap: true
|
|
|
|
smooth: false
|
|
|
|
antialiasing: true
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledTextEdit {
|
|
|
|
id: replyToUsername
|
|
|
|
text: userName
|
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.leftMargin: 20
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 0
|
|
|
|
anchors.left: chatImage.right
|
|
|
|
readOnly: true
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
selectByMouse: true
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: replyText
|
|
|
|
text: Emoji.parse(message, "26x26")
|
|
|
|
anchors.left: replyToUsername.left
|
|
|
|
anchors.top: replyToUsername.bottom
|
|
|
|
anchors.topMargin: 8
|
|
|
|
anchors.right: parent.right
|
2020-09-30 12:33:26 +00:00
|
|
|
anchors.rightMargin: Style.current.padding * 2 + closeButton.width
|
2020-07-09 17:47:36 +00:00
|
|
|
elide: Text.ElideRight
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
font.pixelSize: 15
|
|
|
|
textFormat: Text.RichText
|
|
|
|
}
|
|
|
|
|
2020-09-30 12:33:26 +00:00
|
|
|
}
|