diff options
| author | Kai Uwe Broulik <[email protected]> | 2022-02-23 20:27:33 +0100 |
|---|---|---|
| committer | Kai Uwe Broulik <[email protected]> | 2022-02-23 20:27:33 +0100 |
| commit | cd8190655040566f5b2865f34b3e1d80511fed0b (patch) | |
| tree | 0644cecf02c7028c55c7eb4f0cbec92cb434e8c9 /src | |
| parent | d774088a52b04a28d4e9fc0ae894ac6477d060e0 (diff) | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/kitemviews/kstandarditemlistwidget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index 585a96fbf..c5621840a 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -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; } |
