Summary: | Dolphin show 4 lines of a file even if the maximum length is 3 lines | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Eugenio <eugenio89> |
Component: | view-engine: icons mode | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | emmanuelpescosta099, Vdragon.Taiwan |
Priority: | NOR | ||
Version: | 4.13.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kde-baseapps/a203c271161ce953354b9e0722492605a4d17415 | Version Fixed In: | 4.14.0 |
Sentry Crash Report: | |||
Attachments: | screenshot |
Description
Eugenio
2014-07-05 08:42:55 UTC
Created attachment 87570 [details]
screenshot
Thanks for the bug report, I can reproduce it! 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. My first thought was, that the problems comes from qreal to int conversion (which should be fixed by qFloor) but this isn't the case. Maybe the customized font metric is wrong?! Thanks for the report and for the investigation! This issue looks strange indeed. I could not reproduce it so far - maybe it depends on the font settings. (In reply to comment #4) > I could not reproduce it so far - maybe it depends on the font settings. My settings: Font: System Font (Sans Serif with size 9.0 and 96 DPI) Width: Medium Max. Lines: 3 Icon Size: 80px My settings: Font: Dejavu Sans size 9.0 and 96 DPI Hinting: Medium with RGB subpixel Width: Medium Max. Lines: 3 Icon Size: 32px (but I can reproduce with any size) I played some time with font settings this evening.. This particular file is shown correctly with Hinting Full but some other files are not however shown correctly "LongName.LongLongName.2009.irp.001.mkv" for example is not shown properly and does not depend on hinting here. Qt has different code places where it measures the length of a rendered text string, and if I remember correctly, they do not always lead to the same result, because of differences in handling hinted vs. real metrics, sub-pixel precision, wrapping, or kerning. This can lead to bugs such as 328497, where one function is used to determine the space needed, while the rendering function suddenly believes otherwise. (In reply to Christoph Feck from comment #7) > Qt has different code places where it measures the length of a rendered text > string, and if I remember correctly, they do not always lead to the same > result, because of differences in handling hinted vs. real metrics, > sub-pixel precision, wrapping, or kerning. This can lead to bugs such as > 328497, where one function is used to determine the space needed, while the > rendering function suddenly believes otherwise. Thanks for the info! @Frank Should we decrease the width passed on to elideText (in a loop) as long as nameWidth is bigger than the allowed maxWidth? I see no better solution/workaround for this bug :( (In reply to Emmanuel Pescosta from comment #8) > @Frank > Should we decrease the width passed on to elideText (in a loop) as long as > nameWidth is bigger than the allowed maxWidth? I see no better > solution/workaround for this bug :( I cannot see any other solution either :-( If elidedText is the problem (I still cannot reproduce, it seems that the "Sans Serif" font on this system might be different from yours, and I don't have the Dejavu Snas one), then this might be the only solution indeed. *** Bug 337732 has been marked as a duplicate of this bug. *** Git commit a203c271161ce953354b9e0722492605a4d17415 by Emmanuel Pescosta. Committed on 04/08/2014 at 17:43. Pushed by emmanuelp into branch 'KDE/4.14'. Fix wrong text eliding in some corner cases. FIXED-IN: 4.14.0 REVIEW: 119546 M +18 -8 dolphin/src/kitemviews/kstandarditemlistwidget.cpp http://commits.kde.org/kde-baseapps/a203c271161ce953354b9e0722492605a4d17415 This is not fixed for me with dolphin 4.14.0 :( I have a series of videos that are shown with 4 lines. To test: file name "LongName.LongLongName.2009.irp.001.mkv" Font Dejavu Sans, size 9.0 Hinting RGB medium With name "Calendario.Accademico.Unbla.2013.1.pdf" the bug seems fixed here. (In reply to Eugenio from comment #12) > This is not fixed for me with dolphin 4.14.0 :( > I have a series of videos that are shown with 4 lines. > To test: > file name "LongName.LongLongName.2009.irp.001.mkv" > Font Dejavu Sans, size 9.0 > Hinting RGB medium > With name "Calendario.Accademico.Unbla.2013.1.pdf" the bug seems fixed here. I can't reproduce it here :( Tested with file name "LongName.LongLongName.2009.irp.001.mkv", Dejavu Sans font, size 9.0, all different font styles and medium/full RGB hinting. |