From 240d33ce17fc531e8bc6638af8f71454fe7c05e6 Mon Sep 17 00:00:00 2001 From: Eugene Popov Date: Wed, 27 Mar 2024 10:28:15 +0000 Subject: Better support for RTL This MR fixes some issues related to RTL scripts: - wrong layout in Compact View mode - broken horizontal scrolling in Icon View and Details View modes - broken navigation with left and right arrow keys in Details View mode BUG: 484012 BUG: 449493 --- src/kitemviews/kitemlistview.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/kitemviews/kitemlistview.cpp') diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index f906b7a13..e291ee5ec 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -550,6 +550,10 @@ void KItemListView::scrollToItem(int index, ViewItemPosition viewItemPosition) } QRectF currentRect = itemRect(index); + if (layoutDirection() == Qt::RightToLeft && scrollOrientation() == Qt::Horizontal) { + currentRect.moveTo(m_layouter->size().width() - currentRect.right(), 0); + } + // Fix for Bug 311099 - View the underscore when using Ctrl + PageDown currentRect.adjust(-m_styleOption.horizontalMargin, -m_styleOption.verticalMargin, m_styleOption.horizontalMargin, m_styleOption.verticalMargin); -- cgit v1.3