Bug 512152 - File names containing the "』" unicode character is not vertically centered in Dolphin
Summary: File names containing the "』" unicode character is not vertically centered in...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: details mode (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-15 19:45 UTC by frais64
Modified: 2025-11-22 20:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Non centered text on the 3rd file (88.25 KB, image/png)
2025-11-15 19:52 UTC, frais64
Details

Note You need to log in before you can comment on or make changes to this bug.
Description frais64 2025-11-15 19:45:22 UTC
SUMMARY
Files names containing 

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 frais64 2025-11-15 19:50:28 UTC
Sorry, I missclicked the send button...

SUMMARY
Files names containing the "』" unicode character makes the file name not vertically centered in Dolphin. Maybe it also occurs with other characters but I have not been able to find them. I tested with other fonts and it consistent across all of them.

STEPS TO REPRODUCE
1. create a new file with "』" in it
2. compare it to other files

OBSERVED RESULT
The text is not centered.

EXPECTED RESULT
The text should be vertically centered like other files. 

SOFTWARE/OS VERSIONS

Operating System: Arch Linux
KDE Plasma Version: 6.5.2
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.8-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7640U w/ Radeon 760M Graphics
Memory: 32 GiB of RAM (27.2 GiB usable)
Graphics Processor: AMD Radeon 760M Graphics
dolphin 25.08.3

ADDITIONAL INFORMATION
Comment 2 frais64 2025-11-15 19:52:22 UTC
Created attachment 186822 [details]
Non centered text on the 3rd file
Comment 3 Bug Janitor Service 2025-11-21 03:21:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/1107
Comment 4 Pan Zhang 2025-11-21 09:08:39 UTC
Git commit b39acbf9542bcce929a48070e3f6123eaa74078d by Pan Zhang.
Committed on 21/11/2025 at 03:19.
Pushed by meven into branch 'master'.

kstandarditemlistwidget: Fix vertical misalignment for file names containing certain glyphs

In the Details view the name (text) column could appear vertically off-center for file names containing certain Unicode glyphs (for example "』").  The issue is caused by a mismatch between the generic font metrics ascent and the actual ascent of the rendered QTextLine for that glyph, which shifts the baseline and thus the visual vertical centering.

This change computes the QTextLine ascent for the (single) layouted line and adjusts the vertical position by the difference between the font metrics ascent and the line ascent.  The adjustment is applied only for the name (text) role so other columns are unaffected.

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

https://invent.kde.org/system/dolphin/-/commit/b39acbf9542bcce929a48070e3f6123eaa74078d
Comment 5 Méven 2025-11-22 20:32:39 UTC
Git commit 2e7305e232f50d455ebceee6cdefba85b3635be0 by Méven Car.
Committed on 22/11/2025 at 20:24.
Pushed by meven into branch 'release/25.12'.

kstandarditemlistwidget: Fix vertical misalignment for file names containing certain glyphs

In the Details view the name (text) column could appear vertically off-center for file names containing certain Unicode glyphs (for example "』").  The issue is caused by a mismatch between the generic font metrics ascent and the actual ascent of the rendered QTextLine for that glyph, which shifts the baseline and thus the visual vertical centering.

This change computes the QTextLine ascent for the (single) layouted line and adjusts the vertical position by the difference between the font metrics ascent and the line ascent.  The adjustment is applied only for the name (text) role so other columns are unaffected.


(cherry picked from commit b39acbf9542bcce929a48070e3f6123eaa74078d)

Co-authored-by: Pan Zhang <zhangpan@kylinos.cn>

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

https://invent.kde.org/system/dolphin/-/commit/2e7305e232f50d455ebceee6cdefba85b3635be0