summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-07-01 14:03:00 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-07-01 14:03:00 +0300
commit0ed23506646ff2b8cbd5b99ebce22745740a80da (patch)
treefe10e423d326e081766607f332287ad50050c5c8 /src
parentRemove hardcoded font sizes, margins etc (diff)
downloadnheko-0ed23506646ff2b8cbd5b99ebce22745740a80da.tar.xz
Set emoji size relative to the default font
Diffstat (limited to 'src')
-rw-r--r--src/TimelineItem.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/TimelineItem.cc b/src/TimelineItem.cc

index 12ebcfde..66c55f0c 100644 --- a/src/TimelineItem.cc +++ b/src/TimelineItem.cc
@@ -44,6 +44,8 @@ void TimelineItem::init() const int baseWidth = fm.width('A'); MessageMargin = baseWidth * 1.5; + EmojiSize = this->font().pointSize() * EmojiFontRatio; + topLayout_ = new QHBoxLayout(this); sideLayout_ = new QVBoxLayout(); mainLayout_ = new QVBoxLayout(); @@ -289,7 +291,9 @@ QString TimelineItem::replaceEmoji(const QString &body) // TODO: Be more precise here. if (code > 9000) - fmtBody += "<span style=\"font-family: Emoji One; font-size: 14px\">" + QString(c) + "</span>"; + fmtBody += QString("<span style=\"font-family: Emoji One; font-size: %1px\">").arg(EmojiSize) + + QString(c) + + "</span>"; else fmtBody += c; }