From 88a7794097a8490e4398abf3e36c22ecbfaea7ab Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Thu, 12 Sep 2013 13:58:29 +0200 Subject: [PATCH] Fix Bug 311099 - View the underscore when using Ctrl + PagDown 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 7f1526151..a66715090 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -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(); -- 2.47.3