https://bugs.kde.org/show_bug.cgi?id=432530

Méven <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/syst |https://invent.kde.org/syst
                   |em/dolphin/-/commit/aba0de7 |em/dolphin/-/commit/05194fd
                   |301b060c40d543adbaa8d53cf69 |525071e41678d31b93146fad2e6
                   |a9d7ee                      |e2e451
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #42 from Méven <[email protected]> ---
Git commit 05194fd525071e41678d31b93146fad2e6e2e451 by Méven Car, on behalf of
Bojidar Marinov.
Committed on 04/11/2025 at 09:51.
Pushed by meven into branch 'master'.

icon view: fix file names overflowing after text eliding

aba0de7301b060c40d543adbaa8d53cf69a9d7ee re-introduced the usage of
QFontMetrics::boundingRect(QString) for calculating the size of the last line
of a filename. ..Unfortunately, that function uses a different code path from
QTextLayout, and arrives at a shorter width for a line of text.

Meanwhile, QFontMetrics::size(QString) internally uses
QFontMetric::boundingRect(QRect, int, QString, ..), which has been documented
as "The bounding rectangle returned by this function is somewhat larger than
that calculated by the simpler boundingRect() function. This function uses the
maximum left and right font bearings as is necessary for multi-line text to
align correctly."

I have empirically confirmed that QFontMetricsF::size and
QTextLine::naturalTextWidth return the same floating-point value given the same
input, and QFontMetrics::size does internally use QTextLine::naturalTextWidth
through qt_format_text.

M  +1    -1    src/kitemviews/kstandarditemlistwidget.cpp

https://invent.kde.org/system/dolphin/-/commit/05194fd525071e41678d31b93146fad2e6e2e451

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to