]> cloud.milkyroute.net Git - dolphin.git/commit
Fix selection rect after porting from QFontMetrics::width()
authorIsmael Asensio <isma.af@gmail.com>
Sun, 12 Jul 2020 21:28:02 +0000 (21:28 +0000)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 12 Jul 2020 21:30:14 +0000 (23:30 +0200)
commitbf2eb0d69df085b30a7d7a7fad813ad958893c18
treea5b296594d9688330baba1fc2227cf717cf71569
parentee6e1e030868100b39ea78e4776c36cc8dbb0c41
Fix selection rect after porting from QFontMetrics::width()

After porting from QFontMetrics::width() to QFontMetrics::boundigRect().width() in system/dolphin!10 we have a visual bug on selection rects, that can be seen on details and compact modes.

While from https://kdepepo.wordpress.com/2019/08/05/about-deprecation-of-qfontmetricswidth/ the use of `boundingRect()` would seem the right option to use (and I struggle to get the difference between the two methods when applied to a whole string and not a single char), in this case the `horizontalAdvance()` seems to return the value we need.

BUG: 421973
FIXED-IN: 20.07.70
src/kitemviews/kstandarditemlistwidget.cpp