mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-05 16:19:10 +00:00
Ignore empty roles for textRect calculation
Avoids a text rect taller than the area that actually contains text, as can be seen by hovering files in a folder with "additional roles" that a given file does not contain.
This commit is contained in:
parent
d774088a52
commit
cd81906550
|
@ -1319,7 +1319,11 @@ void KStandardItemListWidget::updateIconsLayoutTextCache()
|
|||
textInfo->staticText.setTextWidth(maxWidth);
|
||||
|
||||
const QRectF textRect(padding + (maxWidth - requiredWidth) / 2, y, requiredWidth, lineSpacing);
|
||||
m_textRect |= textRect;
|
||||
|
||||
// Ignore empty roles. Avoids a text rect taller than the area that actually contains text.
|
||||
if (!textRect.isEmpty()) {
|
||||
m_textRect |= textRect;
|
||||
}
|
||||
|
||||
y += lineSpacing;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue