Remove extra … from reaction text if it is already there
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 <https://github.com/Nheko-Reborn/nheko/pull/982>.
This commit is contained in:
parent
b82b724795
commit
ddf749d3a2
@ -66,7 +66,15 @@ Flow {
|
|||||||
id: reactionText
|
id: reactionText
|
||||||
|
|
||||||
anchors.baseline: reactionCounter.baseline
|
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
|
font.family: Settings.emojiFont
|
||||||
color: reaction.hovered ? Nheko.colors.highlight : Nheko.colors.text
|
color: reaction.hovered ? Nheko.colors.highlight : Nheko.colors.text
|
||||||
maximumLineCount: 1
|
maximumLineCount: 1
|
||||||
|
Loading…
Reference in New Issue
Block a user