Bug 512152

Summary: File names containing the "』" unicode character is not vertically centered in Dolphin
Product: [Applications] dolphin Reporter: frais64
Component: view-engine: details modeAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: dolphin-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Non centered text on the 3rd file

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