Remove replaceEmoji
This commit is contained in:
parent
cdb4c55bb2
commit
21c2302f75
@ -80,8 +80,6 @@ private:
|
||||
void setupAvatarLayout(const QString &userName);
|
||||
void setupSimpleLayout();
|
||||
|
||||
QString replaceEmoji(const QString &body);
|
||||
|
||||
DescInfo descriptionMsg_;
|
||||
|
||||
QHBoxLayout *topLayout_;
|
||||
|
@ -303,12 +303,12 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Text> &event,
|
||||
void
|
||||
TimelineItem::generateBody(const QString &body)
|
||||
{
|
||||
QString content("<span style=\"color: black;\"> %1 </span>");
|
||||
QString content("<span style=\"color: black; font-family: EmojiOne Color, Open Sans;\"> %1 </span>");
|
||||
|
||||
body_ = new QLabel(this);
|
||||
body_->setFont(font_);
|
||||
body_->setWordWrap(true);
|
||||
body_->setText(content.arg(replaceEmoji(body)));
|
||||
body_->setText(content.arg(body));
|
||||
body_->setMargin(0);
|
||||
|
||||
body_->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction);
|
||||
@ -341,7 +341,7 @@ TimelineItem::generateBody(const QString &userid, const QString &body)
|
||||
body_ = new QLabel(this);
|
||||
body_->setFont(font_);
|
||||
body_->setWordWrap(true);
|
||||
body_->setText(bodyContent.arg(replaceEmoji(body)));
|
||||
body_->setText(bodyContent.arg(body));
|
||||
body_->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction);
|
||||
body_->setOpenExternalLinks(true);
|
||||
body_->setMargin(0);
|
||||
@ -364,27 +364,6 @@ TimelineItem::generateTimestamp(const QDateTime &time)
|
||||
timestamp_->setContentsMargins(0, topMargin, 0, 0);
|
||||
}
|
||||
|
||||
QString
|
||||
TimelineItem::replaceEmoji(const QString &body)
|
||||
{
|
||||
QString fmtBody = "";
|
||||
|
||||
for (auto &c : body) {
|
||||
int code = c.unicode();
|
||||
|
||||
// TODO: Be more precise here.
|
||||
if (code > 9000)
|
||||
fmtBody += QString("<span style=\"font-family: Emoji "
|
||||
"One; font-size: %1px\">")
|
||||
.arg(conf::emojiSize) +
|
||||
QString(c) + "</span>";
|
||||
else
|
||||
fmtBody += c;
|
||||
}
|
||||
|
||||
return fmtBody;
|
||||
}
|
||||
|
||||
void
|
||||
TimelineItem::setupAvatarLayout(const QString &userName)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user