mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 04:28:49 +03:00
Second attempt to fix failback text size for ImageItem
This commit is contained in:
parent
1d7548dae2
commit
96e99710fc
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.height() + metrics.lineSpacing();
|
||||
const int fontHeight = metrics.height() + metrics.ascent();
|
||||
|
||||
if (image_.isNull()) {
|
||||
QString elidedText = metrics.elidedText(text_, Qt::ElideRight, max_width_ - 10);
|
||||
|
@ -223,7 +223,7 @@ ImageItem::paintEvent(QPaintEvent *event)
|
|||
|
||||
// Bottom text section
|
||||
if (underMouse()) {
|
||||
const int textBoxHeight = 2 * fontHeight;
|
||||
const int textBoxHeight = fontHeight / 2 + 6;
|
||||
|
||||
textRegion_ = QRectF(0, height_ - textBoxHeight, width_, textBoxHeight);
|
||||
|
||||
|
|
Loading…
Reference in a new issue