Clean up reply.

This commit is contained in:
Black Hat
2019-07-21 13:01:33 +08:00
parent f0735981cd
commit 992cbaca87
5 changed files with 23 additions and 27 deletions

View File

@@ -15,7 +15,7 @@ ColumnLayout {
readonly property bool avatarVisible: !sentByMe && showAuthor
readonly property bool sentByMe: author === currentRoom.localUser
readonly property bool darkBackground: !sentByMe
readonly property bool replyVisible: replyEventId || false
readonly property bool replyVisible: reply || false
signal saveFileAs()
signal openExternally()
@@ -144,15 +144,15 @@ ColumnLayout {
Layout.preferredHeight: 28
Layout.alignment: Qt.AlignTop
source: replyVisible ? replyAuthor.avatarMediaId : ""
hint: replyVisible ? replyAuthor.displayName : "H"
source: replyVisible ? reply.author.avatarMediaId : ""
hint: replyVisible ? reply.author.displayName : "H"
RippleEffect {
anchors.fill: parent
circular: true
onClicked: userDetailDialog.createObject(ApplicationWindow.overlay, {"room": currentRoom, "user": replyAuthor}).open()
onClicked: userDetailDialog.createObject(ApplicationWindow.overlay, {"room": currentRoom, "user": reply.author}).open()
}
}
@@ -160,7 +160,7 @@ ColumnLayout {
Layout.fillWidth: true
color: !sentByMe ? MPalette.foreground : "white"
text: "<style>a{color: " + color + ";} .user-pill{}</style>" + (replyDisplay || "")
text: "<style>a{color: " + color + ";} .user-pill{}</style>" + (replyVisible ? reply.display : "")
wrapMode: Label.Wrap
textFormat: Label.RichText
@@ -168,13 +168,13 @@ ColumnLayout {
}
background: Rectangle {
color: replyAuthor && sentByMe ? replyAuthor.color : MPalette.background
color: replyVisible && sentByMe ? reply.author.color : MPalette.background
radius: 18
AutoMouseArea {
anchors.fill: parent
onClicked: goToEvent(replyEventId)
onClicked: goToEvent(reply.eventId)
}
}
}