diff --git a/src/qml/Component/Timeline/RichLabel.qml b/src/qml/Component/Timeline/RichLabel.qml index d41745cbc..ea49943a5 100644 --- a/src/qml/Component/Timeline/RichLabel.qml +++ b/src/qml/Component/Timeline/RichLabel.qml @@ -27,7 +27,12 @@ TextEdit { /** * @brief Regex for detecting a message with a single emoji. */ - readonly property var isEmoji: /^()?(\u00a9|\u00ae|[\u20D0-\u2fff]|[\u3190-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])+(<\/span>)?$/ + readonly property var isEmojiRegex: /^()?(\u00a9|\u00ae|[\u20D0-\u2fff]|[\u3190-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])+(<\/span>)?$/ + + /** + * @brief Whether the message is an emoji + */ + readonly property var isEmoji: isEmojiRegex.test(textMessage) /** * @brief Regex for detecting a message with a spoiler. @@ -85,7 +90,10 @@ a{ color: Kirigami.Theme.textColor selectedTextColor: Kirigami.Theme.highlightedTextColor selectionColor: Kirigami.Theme.highlightColor - font.pointSize: !root.isReply && isEmoji.test(textMessage) ? Kirigami.Theme.defaultFont.pointSize * 4 : Kirigami.Theme.defaultFont.pointSize + font { + pointSize: !root.isReply && root.isEmoji ? Kirigami.Theme.defaultFont.pointSize * 4 : Kirigami.Theme.defaultFont.pointSize + family: root.isEmoji ? 'emoji' : Kirigami.Theme.defaultFont.family + } selectByMouse: !Kirigami.Settings.isMobile readOnly: true wrapMode: Text.Wrap