Bug 449211

Summary: Detail View mode doesn't support RTL properly
Product: [Applications] dolphin Reporter: Zayed Al-Saidi <zayed.alsaidi>
Component: view-engine: details modeAssignee: Janet Blackquill <uhhadd>
Status: RESOLVED FIXED    
Severity: normal CC: felixernst, kfm-devel, mskf1383, sh.yaron, uhhadd
Priority: NOR Keywords: rtl
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Wrong layout of the tree in RTL mode
Correct standard QTreeWidget with Qt::RightToLeft

Description Zayed Al-Saidi 2022-01-26 18:34:08 UTC
Created attachment 145968 [details]
Wrong layout of the tree in RTL mode

SUMMARY
***
the layout of Detail view mode with RTL mode is wrong. The the tree must be on the right side.
***


STEPS TO REPRODUCE
1. run dolphin  -reverse 
2. 
3. 

OBSERVED RESULT
the tree is set to be on the left side. 

EXPECTED RESULT
the tree must be in the right side, please see the standard QTreeWidget with Qt::RightToLeft property in the second screenshot.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-40-generic (64-bit)
Graphics Platform: X11
Processors: 3 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 4.9 غ.بايت of RAM
Graphics Processor: llvmpipe 

ADDITIONAL INFORMATION
Comment 1 Zayed Al-Saidi 2022-01-26 18:35:21 UTC
Created attachment 145970 [details]
Correct standard QTreeWidget with Qt::RightToLeft
Comment 2 Bug Janitor Service 2022-02-02 01:20:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/339
Comment 3 Janet Blackquill 2022-02-25 16:35:18 UTC
Git commit ddba4f5fd88c4fa855e3f2eb0d9d95a6290d150a by Janet Blackquill.
Committed on 25/02/2022 at 16:35.
Pushed by cblack into branch 'master'.

KStandardItemListWidget: handle RtL drawing properly

M  +65   -16   src/kitemviews/kstandarditemlistwidget.cpp

https://invent.kde.org/system/dolphin/commit/ddba4f5fd88c4fa855e3f2eb0d9d95a6290d150a
Comment 4 Felix Ernst 2022-04-04 12:15:46 UTC
Re-opening this since the commit used to mark this bug report as resolved caused a bunch of regressions and had to be reverted in https://invent.kde.org/system/dolphin/-/commit/a4f9974daf1e533c39f67129b85193ad4d47e5ad.
Comment 5 Bug Janitor Service 2024-12-18 14:03:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/877
Comment 6 Felix Ernst 2024-12-29 11:42:34 UTC
Git commit 95542a389112491abf3a31c338e7d78f7785f48e by Felix Ernst.
Committed on 29/12/2024 at 11:42.
Pushed by felixernst into branch 'master'.

Mirror details view mode for right-to-left languages

This commit implements mirroring of the details view mode for right-to-
left languages. This is the last of the Dolphin view modes which did
not adapt to right-to-left languages correctly.

Implementation-wise this is mostly about adapting the math so all the
information is placed correctly no matter the view mode or layout
direction. While most of the view actually changes the painting code
for right-to-left languages, for the column header I decided to keep
the logic left-to-right and instead reverse the order of the role
columns.

To implement this mirroring I needed to rework quite a bit of logic, so
I used the opportunity to fix some bugs/behaviur quirks:
- Left and right padding is now saved and restored separately instead
  of only saving the left padding
- Changing the right padding no longer disables "automatic column
  resizing".
- The grip handles for column resizing can now be grabbed when near the
  grip handle instead of only allowing grabbing when slightly to the
  left of the grip.
- Role column headers now only show a hover highlight effect when the
  mouse cursor is actually above that role and not above the grip
  handle or the padding.
- There is now a soft-boarder when shrinking the right padding so
  shrinking the padding "below zero width" will no longer immediately
  clear automatic resize behaviour. So now it is possible to simply
  remove the right padding by resizing it to zero width.
Related: bug 495942

# Acknowledgement

This work is part of a my project funded through the NGI0 Entrust Fund,
a fund established by NLnet with financial support from the European
Commission's Next Generation Internet programme, under the aegis of DG
Communications Networks, Content and Technology.

M  +14   -28   src/kitemviews/kitemlistcontroller.cpp
M  +10   -5    src/kitemviews/kitemlistheader.cpp
M  +5    -4    src/kitemviews/kitemlistheader.h
M  +6    -6    src/kitemviews/kitemlistview.cpp
M  +30   -11   src/kitemviews/kitemlistwidget.cpp
M  +6    -4    src/kitemviews/kitemlistwidget.h
M  +48   -25   src/kitemviews/kstandarditemlistwidget.cpp
M  +2    -1    src/kitemviews/kstandarditemlistwidget.h
M  +182  -144  src/kitemviews/private/kitemlistheaderwidget.cpp
M  +25   -12   src/kitemviews/private/kitemlistheaderwidget.h
M  +6    -2    src/settings/dolphin_detailsmodesettings.kcfg
M  +7    -1    src/settings/dolphin_detailsmodesettings.upd
M  +9    -4    src/settings/viewmodes/viewsettingstab.cpp
M  +10   -5    src/views/dolphinview.cpp
M  +1    -1    src/views/dolphinview.h

https://invent.kde.org/system/dolphin/-/commit/95542a389112491abf3a31c338e7d78f7785f48e