mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Add enough space for the failback text in ImageItem
This commit is contained in:
parent
07a4e38ed8
commit
117a739bc4
1 changed files with 2 additions and 2 deletions
|
@ -198,7 +198,7 @@ ImageItem::paintEvent(QPaintEvent *event)
|
|||
font.setPixelSize(conf::fontSize);
|
||||
|
||||
QFontMetrics metrics(font);
|
||||
const int fontHeight = metrics.ascent();
|
||||
const int fontHeight = metrics.height() + metrics.lineSpacing();
|
||||
|
||||
if (image_.isNull()) {
|
||||
QString elidedText = metrics.elidedText(text_, Qt::ElideRight, max_width_ - 10);
|
||||
|
@ -207,7 +207,7 @@ ImageItem::paintEvent(QPaintEvent *event)
|
|||
|
||||
painter.setFont(font);
|
||||
painter.setPen(QPen(QColor(66, 133, 244)));
|
||||
painter.drawText(QPoint(0, fontHeight), elidedText);
|
||||
painter.drawText(QPoint(0, fontHeight / 2), elidedText);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue