From ddf749d3a2fda3bcc203c481faf329bbb635622d Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 9 Mar 2022 18:37:50 +0100 Subject: [PATCH] =?UTF-8?q?Remove=20extra=20=E2=80=A6=20from=20reaction=20?= =?UTF-8?q?text=20if=20it=20is=20already=20there?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit elidedText should have … in it if the text doesn't fit, but it seems that it is omitted if the emoji font doesn't have it. 🙄 See . --- resources/qml/Reactions.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/qml/Reactions.qml b/resources/qml/Reactions.qml index f79cfe73..cb2bcb24 100644 --- a/resources/qml/Reactions.qml +++ b/resources/qml/Reactions.qml @@ -66,7 +66,15 @@ Flow { id: reactionText anchors.baseline: reactionCounter.baseline - text: textMetrics.elidedText + (textMetrics.elidedText == modelData.displayKey ? "" : "…") + text: { + // When an emoji font is selected that doesn't have …, it is dropped from elidedText. So we add it back. + if (textMetrics.elidedText !== modelData.displayKey) { + if (!textMetrics.elidedText.endsWith("…")) { + return textMetrics.elidedText + "…"; + } + } + return textMetrics.elidedText; + } font.family: Settings.emojiFont color: reaction.hovered ? Nheko.colors.highlight : Nheko.colors.text maximumLineCount: 1