mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Strip variant selector in some cases
fixes #439 Workaround for https://bugreports.qt.io/browse/QTBUG-97401 fixes #810
This commit is contained in:
parent
a206500510
commit
7685d1808b
4 changed files with 17 additions and 9 deletions
|
@ -34,6 +34,7 @@ Flow {
|
||||||
implicitHeight: contentItem.childrenRect.height
|
implicitHeight: contentItem.childrenRect.height
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
ToolTip.text: modelData.users
|
ToolTip.text: modelData.users
|
||||||
|
ToolTip.delay: Nheko.tooltipDelay
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.debug("Picked " + modelData.key + "in response to " + reactionFlow.eventId + ". selfReactedEvent: " + modelData.selfReactedEvent);
|
console.debug("Picked " + modelData.key + "in response to " + reactionFlow.eventId + ". selfReactedEvent: " + modelData.selfReactedEvent);
|
||||||
room.input.reaction(reactionFlow.eventId, modelData.key);
|
room.input.reaction(reactionFlow.eventId, modelData.key);
|
||||||
|
@ -51,14 +52,14 @@ Flow {
|
||||||
font.family: Settings.emojiFont
|
font.family: Settings.emojiFont
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
elideWidth: 150
|
elideWidth: 150
|
||||||
text: modelData.key
|
text: modelData.displayKey
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: reactionText
|
id: reactionText
|
||||||
|
|
||||||
anchors.baseline: reactionCounter.baseline
|
anchors.baseline: reactionCounter.baseline
|
||||||
text: textMetrics.elidedText + (textMetrics.elidedText == modelData.key ? "" : "…")
|
text: textMetrics.elidedText + (textMetrics.elidedText == modelData.displayKey ? "" : "…")
|
||||||
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
|
||||||
|
|
|
@ -166,7 +166,7 @@ Menu {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
font.family: Settings.emojiFont
|
font.family: Settings.emojiFont
|
||||||
font.pixelSize: 36
|
font.pixelSize: 36
|
||||||
text: model.unicode
|
text: model.unicode.replace('\ufe0f', '')
|
||||||
color: Nheko.colors.text
|
color: Nheko.colors.text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,8 +135,13 @@ utils::replaceEmoji(const QString &body)
|
||||||
fmtBody += QStringLiteral("<font face=\"") % UserSettings::instance()->emojiFont() %
|
fmtBody += QStringLiteral("<font face=\"") % UserSettings::instance()->emojiFont() %
|
||||||
QStringLiteral("\">");
|
QStringLiteral("\">");
|
||||||
insideFontBlock = true;
|
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 {
|
} else {
|
||||||
if (insideFontBlock) {
|
if (insideFontBlock) {
|
||||||
fmtBody += QStringLiteral("</font>");
|
fmtBody += QStringLiteral("</font>");
|
||||||
|
|
|
@ -11,13 +11,15 @@
|
||||||
struct Reaction
|
struct Reaction
|
||||||
{
|
{
|
||||||
Q_GADGET
|
Q_GADGET
|
||||||
Q_PROPERTY(QString key READ key)
|
Q_PROPERTY(QString key READ key CONSTANT)
|
||||||
Q_PROPERTY(QString users READ users)
|
Q_PROPERTY(QString displayKey READ displayKey CONSTANT)
|
||||||
Q_PROPERTY(QString selfReactedEvent READ selfReactedEvent)
|
Q_PROPERTY(QString users READ users CONSTANT)
|
||||||
Q_PROPERTY(int count READ count)
|
Q_PROPERTY(QString selfReactedEvent READ selfReactedEvent CONSTANT)
|
||||||
|
Q_PROPERTY(int count READ count CONSTANT)
|
||||||
|
|
||||||
public:
|
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 users() const { return users_.toHtmlEscaped(); }
|
||||||
QString selfReactedEvent() const { return selfReactedEvent_; }
|
QString selfReactedEvent() const { return selfReactedEvent_; }
|
||||||
int count() const { return count_; }
|
int count() const { return count_; }
|
||||||
|
|
Loading…
Reference in a new issue