Fix wrong text eliding in some corner cases.

Review Request #119546 - Created July 30, 2014 and submitted

Information
Emmanuel Pescosta
kde-baseapps
KDE/4.14
437104
Reviewers
dolphin

The problem is in KStandardItemListWidget::updateIconsLayoutTextCache().

m_customizedFontMetrics.elidedText(lastTextLine, Qt::ElideRight, maxWidth) returns a non-elided text (which is wrong in thi case) and the resulting nameWidth is bigger than maxWidth. When I replace maxWidth by "maxWidth - 1" the eliding is correct and it works fine.

I have solved it with a loop, which decreases the eliding width as long as the bounding rect width is bigger than the allowed maximum width.

No wrong text eliding anymore :)

Frank Reininghaus
Emmanuel Pescosta
Review request changed

Status: Closed (submitted)

Loading...