Review Request 112265: Fix filename trucation issues in Icons View with maximum number of lines

Christoph Feck christoph at maxiom.de
Sun Aug 25 13:09:29 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112265/#review38528
-----------------------------------------------------------



dolphin/src/kitemviews/kstandarditemlistwidget.cpp
<http://git.reviewboard.kde.org/r/112265/#comment28494>

    Please use QFontMetrics::boundingRect().width().
    
    QFontMetrics::width() is the "advance size", not the bounding rectangle size.


- Christoph Feck


On Aug. 25, 2013, 11:23 a.m., Frank Reininghaus wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/112265/
> -----------------------------------------------------------
> 
> (Updated Aug. 25, 2013, 11:23 a.m.)
> 
> 
> Review request for Dolphin and Christoph Feck.
> 
> 
> Description
> -------
> 
> 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 are several problems at the moment:
> 
> (a) "lastTextLine", which contains the text to be elided, is 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() is 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, is not updated correctly.
> 
> The result is that the text is 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.
> 
> The patch fixes these issues.
> 
> 
> This addresses bugs 304558 and 321882.
>     http://bugs.kde.org/show_bug.cgi?id=304558
>     http://bugs.kde.org/show_bug.cgi?id=321882
> 
> 
> Diffs
> -----
> 
>   dolphin/src/kitemviews/kstandarditemlistwidget.cpp 483517e 
> 
> Diff: http://git.reviewboard.kde.org/r/112265/diff/
> 
> 
> Testing
> -------
> 
> Fixes the bugs I linked to. I have not observed any regressions so far in Icons View (also tried to enable some "additional information").
> 
> 
> Thanks,
> 
> Frank Reininghaus
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130825/53f35aad/attachment.htm>


More information about the kfm-devel mailing list