Skip to content
Snippets Groups Projects
Verified Commit 7685d180 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Strip variant selector in some cases

fixes #439
Workaround for https://bugreports.qt.io/browse/QTBUG-97401
fixes #810
parent a2065005
No related branches found
No related tags found
No related merge requests found
Pipeline #2453 failed
......@@ -34,6 +34,7 @@ Flow {
implicitHeight: contentItem.childrenRect.height
ToolTip.visible: hovered
ToolTip.text: modelData.users
ToolTip.delay: Nheko.tooltipDelay
onClicked: {
console.debug("Picked " + modelData.key + "in response to " + reactionFlow.eventId + ". selfReactedEvent: " + modelData.selfReactedEvent);
room.input.reaction(reactionFlow.eventId, modelData.key);
......@@ -51,14 +52,14 @@ Flow {
font.family: Settings.emojiFont
elide: Text.ElideRight
elideWidth: 150
text: modelData.key
text: modelData.displayKey
}
Text {
id: reactionText
anchors.baseline: reactionCounter.baseline
text: textMetrics.elidedText + (textMetrics.elidedText == modelData.key ? "" : "")
text: textMetrics.elidedText + (textMetrics.elidedText == modelData.displayKey ? "" : "")
font.family: Settings.emojiFont
color: reaction.hovered ? Nheko.colors.highlight : Nheko.colors.text
maximumLineCount: 1
......
......@@ -166,7 +166,7 @@ Menu {
verticalAlignment: Text.AlignVCenter
font.family: Settings.emojiFont
font.pixelSize: 36
text: model.unicode
text: model.unicode.replace('\ufe0f', '')
color: Nheko.colors.text
}
......
......@@ -135,8 +135,13 @@ utils::replaceEmoji(const QString &body)
fmtBody += QStringLiteral("<font face=\"") % UserSettings::instance()->emojiFont() %
QStringLiteral("\">");
insideFontBlock = true;
} else if (code == 0xfe0f) {
// BUG(Nico):
// Workaround https://bugreports.qt.io/browse/QTBUG-97401
// See also https://github.com/matrix-org/matrix-react-sdk/pull/1458/files
// Nheko bug: https://github.com/Nheko-Reborn/nheko/issues/439
continue;
}
} else {
if (insideFontBlock) {
fmtBody += QStringLiteral("</font>");
......
......@@ -11,13 +11,15 @@
struct Reaction
{
Q_GADGET
Q_PROPERTY(QString key READ key)
Q_PROPERTY(QString users READ users)
Q_PROPERTY(QString selfReactedEvent READ selfReactedEvent)
Q_PROPERTY(int count READ count)
Q_PROPERTY(QString key READ key CONSTANT)
Q_PROPERTY(QString displayKey READ displayKey CONSTANT)
Q_PROPERTY(QString users READ users CONSTANT)
Q_PROPERTY(QString selfReactedEvent READ selfReactedEvent CONSTANT)
Q_PROPERTY(int count READ count CONSTANT)
public:
QString key() const { return key_.toHtmlEscaped(); }
QString key() const { return key_; }
QString displayKey() const { return key_.toHtmlEscaped().remove(QStringLiteral(u"\ufe0f")); }
QString users() const { return users_.toHtmlEscaped(); }
QString selfReactedEvent() const { return selfReactedEvent_; }
int count() const { return count_; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment