]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Do not skip rows in when clicking the empty area of the scroll bar
authorFrank Reininghaus <frank78ac@googlemail.com>
Mon, 11 Mar 2013 17:18:25 +0000 (18:18 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Mon, 11 Mar 2013 17:18:44 +0000 (18:18 +0100)
The height of the header widget must be subtracted from the view's
height in Details View to determine the "pageStep" for the scroll bar.

BUG: 315619
FIXED-IN: 4.10.2
REVIEW: 109210

src/kitemviews/kitemlistcontainer.cpp
src/kitemviews/kitemlistview.cpp
src/kitemviews/kitemlistview.h

index 5500851c8c92c564bf3130c66198cea9b61eb8c7..3bd8067a8f3c9b0be16e11f91ac1d4ce29b30155 100644 (file)
@@ -261,7 +261,9 @@ void KItemListContainer::updateScrollOffsetScrollBar()
         smoothScroller = m_verticalSmoothScroller;
         scrollOffsetScrollBar = verticalScrollBar();
         singleStep = view->itemSize().height();
-        pageStep = view->size().height();
+        // We cannot use view->size().height() because this height might
+        // include the header widget, which is not part of the scrolled area.
+        pageStep = view->verticalPageStep();
     } else {
         smoothScroller = m_horizontalSmoothScroller;
         scrollOffsetScrollBar = horizontalScrollBar();
index 6a68ae79899e18c1f3127f992ab8b9276221b3ff..9ebad7f8bda0a99a43256c6c529bed4027d689e8 100644 (file)
@@ -388,6 +388,15 @@ void KItemListView::setGeometry(const QRectF& rect)
     }
 }
 
+qreal KItemListView::verticalPageStep() const
+{
+    qreal headerHeight = 0;
+    if (m_headerWidget->isVisible()) {
+        headerHeight = m_headerWidget->size().height();
+    }
+    return size().height() - headerHeight;
+}
+
 int KItemListView::itemAt(const QPointF& pos) const
 {
     QHashIterator<int, KItemListWidget*> it(m_visibleItems);
index 2baf20c94079bd7934a313f7f294d2323d6a39ad..cd59ddcb536265e22bdf8f3fda3aa5f5a8798525 100644 (file)
@@ -162,6 +162,12 @@ public:
     /** @reimp */
     virtual void setGeometry(const QRectF& rect);
 
+    /**
+     * @return The page step which should be used by the vertical scroll bar.
+     *         This is the height of the view except for the header widget.
+     */
+    qreal verticalPageStep() const;
+
     /**
      * @return Index of the item that is below the point \a pos.
      *         The position is relative to the upper right of