From: Emmanuel Pescosta Date: Thu, 12 Sep 2013 11:58:29 +0000 (+0200) Subject: Fix Bug 311099 - View the underscore when using Ctrl + PagDown X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/88a7794097a8490e4398abf3e36c22ecbfaea7ab 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 --- 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();