]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix Bug 311099 - View the underscore when using Ctrl + PagDown
authorEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Thu, 12 Sep 2013 11:58:29 +0000 (13:58 +0200)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Thu, 12 Sep 2013 11:58:29 +0000 (13:58 +0200)
Take the style option vertical/horizontal margin into account
for the calculation of the new scroll offset.

Thanks to Frank for pointing out two other problems with "Page Up/Down" and providing
a better way to fix these problems. :)

BUG: 311099
FIXED-IN: 4.11.2
REVIEW: 112678

src/kitemviews/kitemlistview.cpp

index 7f15261511b3f77f19beb38b1f350b57ca952d7a..a667150904147ecd72568abdf95e9eb0ce332739 100644 (file)
@@ -504,7 +504,11 @@ void KItemListView::scrollToItem(int index)
         const qreal headerHeight = m_headerWidget->size().height();
         viewGeometry.adjust(0, headerHeight, 0, 0);
     }
-    const QRectF currentRect = itemRect(index);
+    QRectF currentRect = itemRect(index);
+
+    // Fix for Bug 311099 - View the underscore when using Ctrl + PagDown
+    currentRect.adjust(-m_styleOption.horizontalMargin, -m_styleOption.verticalMargin,
+                        m_styleOption.horizontalMargin,  m_styleOption.verticalMargin);
 
     if (!viewGeometry.contains(currentRect)) {
         qreal newOffset = scrollOffset();