X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/808339bff654785d564d6c7d077062f6c649ff77..b65576a131eb59eaab4d33af830bdb2d2f9fde9f:/src/kitemviews/kitemlistcontainer.cpp diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp index a3cafc838..6279b15a9 100644 --- a/src/kitemviews/kitemlistcontainer.cpp +++ b/src/kitemviews/kitemlistcontainer.cpp @@ -26,6 +26,7 @@ #include "private/kitemlistsmoothscroller.h" #include +#include #include #include #include @@ -260,7 +261,14 @@ void KItemListContainer::updateScrollOffsetScrollBar() if (view->scrollOrientation() == Qt::Vertical) { smoothScroller = m_verticalSmoothScroller; scrollOffsetScrollBar = verticalScrollBar(); - singleStep = view->itemSizeHint().height(); + + // Don't scroll super fast when using a wheel mouse: + // We want to consider one "line" to be the text label which has a + // roughly fixed height rather than using the height of the icon which + // may be very tall + const QFontMetrics metrics(font()); + singleStep = metrics.height() * QApplication::wheelScrollLines(); + // 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();