Skip to content
  • Frank Reininghaus's avatar
    Fix filename trucation issues in Icons View with maximum number of lines · f830e117
    Frank Reininghaus authored
    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
    f830e117