mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
Restrict display name width to 500px
This commit is contained in:
parent
9d763c4de9
commit
e57f5f848b
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue