Use more adapted delegate for showing emote (/me)

Now use a standard MessageDelegate and don't display the title part.
This now make the reply and reaction button available and also make it
possible to see the reactions.

Fix: #69
Fix: #75
This commit is contained in:
Carl Schwan
2020-11-27 15:29:11 +01:00
parent c1dccf7a7e
commit 550cef52d0
4 changed files with 47 additions and 24 deletions

View File

@@ -11,12 +11,13 @@ import org.kde.kirigami 2.4 as Kirigami
TextEdit {
id: contentLabel
text: "<style>pre {white-space: pre-wrap} a{color: " + Kirigami.Theme.linkColor + ";} .user-pill{}</style>" + display
color: Kirigami.Theme.textColor
readonly property var isEmoji: /^(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])+$/
property bool isEmote: false
text: "<style>pre {white-space: pre-wrap} a{color: " + Kirigami.Theme.linkColor + ";} .user-pill{}</style>" + (isEmote ? "* <a href='https://matrix.to/#/" + author.id + "' style='color: " + author.color + "'>" + author.displayName + "</a> " : "") + display
color: Kirigami.Theme.textColor
font.pointSize: isEmoji.test(message) ? Kirigami.Theme.defaultFont.pointSize * 4 : Kirigami.Theme.defaultFont.pointSize
selectByMouse: !Kirigami.Settings.isMobile
readOnly: true