From e57f5f848b817a4dae0f2fe7c97c4b711e9e01a7 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sat, 23 Dec 2017 14:06:59 +0200 Subject: [PATCH] Restrict display name width to 500px --- src/timeline/TimelineItem.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/timeline/TimelineItem.cc b/src/timeline/TimelineItem.cc index 0534ab7d..f986a0a6 100644 --- a/src/timeline/TimelineItem.cc +++ b/src/timeline/TimelineItem.cc @@ -344,9 +344,11 @@ TimelineItem::generateBody(const QString &userid, const QString &body) QFont usernameFont = font_; usernameFont.setBold(true); + QFontMetrics fm(usernameFont); + userName_ = new QLabel(this); userName_->setFont(usernameFont); - userName_->setText(sender); + userName_->setText(fm.elidedText(sender, Qt::ElideRight, 500)); if (body.isEmpty()) return;