[system/dolphin] src/kitemviews: kstandarditemlist: Fix RTL rename field in details mode

Méven Car <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit ff53e05b16aabd9d63b0e5df9e0b40dd81dc6aa9 by Méven Car, on behalf of Akseli Lahtinen.
Committed on 21/07/2026 at 12:25.
Pushed by meven into branch 'master'.

kstandarditemlist: Fix RTL rename field in details mode

Ensure we calculate the width from correct
position in RightToLeft mode for
the details view rename field.

BUG: 503052

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

https://invent.kde.org/system/dolphin/-/commit/ff53e05b16aabd9d63b0e5df9e0b40dd81dc6aa9

diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp
index bbafa3afaa..edc8bfa789 100644
--- a/src/kitemviews/kstandarditemlistwidget.cpp
+++ b/src/kitemviews/kstandarditemlistwidget.cpp
@@ -1708,7 +1708,11 @@ QRectF KStandardItemListWidget::roleEditingRect(const QByteArray &role) const
 
     QRectF rect(textInfo->pos, textInfo->staticText.size());
     if (m_layout == DetailsLayout) {
-        rect.setWidth(columnWidth(role) - rect.x());
+        if (layoutDirection() == Qt::LeftToRight) {
+            rect.setWidth(columnWidth(role) - rect.x());
+        } else {
+            rect.setX(m_columnWidthSum - columnWidth(role) + leftPadding() + rightPadding());
+        }
     }
 
     return rect;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.