]> cloud.milkyroute.net Git - dolphin.git/commit
Fix filename trucation issues in Icons View with maximum number of lines
authorFrank Reininghaus <frank78ac@googlemail.com>
Sun, 25 Aug 2013 14:24:20 +0000 (16:24 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sun, 25 Aug 2013 14:27:36 +0000 (16:27 +0200)
commitf830e1179ceb7bb31e449215294e5f0ffa3ed6ec
treee7dc837bd767306176d27db6cda8a2f42b5a019c
parent2bdce34fe1e6613d2747ab798bccb4fa7de8ca3e
Fix filename trucation issues in Icons View with maximum number of lines

When the name of a file is too long to be shown inside the maximum
number of lines, the last line is elided. However, there were several
problems before this commit:

(a) "lastTextLine", which contains the text to be elided, was not
    assigned the complete remaining text, but only the part that would
    be put into the last line if there were more lines following. This
    may be less than what would fit into the line because we try to not
    break the text at random points.

(b) QFontMetrics::elidedText() was not given the width that is available
    for the last line (that would be maxWidth), but only the width that
    would be occupied by the text if there were more lines following
    (line.naturalTextWidth()).

(c) The variable "nameWidth", which is required to calculate the QRectF
    that is reserved for the name, was not updated correctly.

The result is that the text was sometimes trucated too early (especially
if there would be a line break early in the text if we had more lines
available), that there may be insufficient space to show the "...", and
that the hover/selection rectangle might be too narrow.

BUG: 304558
BUG: 321882
FIXED-IN: 4.11.1
REVIEW: 112265
src/kitemviews/kstandarditemlistwidget.cpp