Commit cd819065 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

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.
parent d774088a
Pipeline #141637 passed with stage
in 1 minute and 52 seconds
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment