diff options
| author | Nate Graham <[email protected]> | 2019-12-21 11:54:53 -0700 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2019-12-21 11:54:53 -0700 |
| commit | 080498368502bfbdc4e13427ba3a9a21cefcafdf (patch) | |
| tree | 617dfb2bb75b3df05758beafb08d0e5aacba6e84 /src/kitemviews/kitemlistcontainer.cpp | |
| parent | 616d4e6bdd707ac819707263255809df576a8c2b (diff) | |
| parent | 403de19d9c036dd28481d3b62bdb0f49f0792fbf (diff) | |
Merge branch 'release/19.12'
Diffstat (limited to 'src/kitemviews/kitemlistcontainer.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistcontainer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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 <QApplication> +#include <QFontMetrics> #include <QGraphicsScene> #include <QGraphicsView> #include <QScrollBar> @@ -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(); |
