diff options
| author | Felix Ernst <[email protected]> | 2025-09-01 18:34:01 +0200 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2025-09-07 23:28:37 +0200 |
| commit | 76b2443130955a7a830d06ef23f647950ad48507 (patch) | |
| tree | 1d22ec940341ff7c8ed096db2ba6c976dd19a6e2 /src/kitemviews | |
| parent | fb4a4eb1884da2192bf17ab4f92f2ff01f531044 (diff) | |
Double scroll distance
This commit doubles the distance a single scroll tick will scroll
in the main view.
While fixing a bug and improving scroll behaviour in
8e3addb7e73122a4c89ef347b03f714ff75a253a, the scroll distance was
effectively reduced to a third of the original value. Most users
seem to be okay with this, but there is some disgruntlement. Even
though the new scroll speed is consistent with KWrite, it is way
slower than e.g. Firefox.
In a perfect world we would have a similar scroll distance in every
scroll area so users could predict how much they have to scroll to
see a certain part of the content, however we are not there yet.
This commit aims to find a middle ground between our own definition
of scroll distance and user expectation.
BUG: 508290
Diffstat (limited to 'src/kitemviews')
| -rw-r--r-- | src/kitemviews/kitemlistview.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 69a800cdf..a83c3ad39 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -400,8 +400,15 @@ void KItemListView::setGeometry(const QRectF &rect) qreal KItemListView::scrollSingleStep() const { + /** + * The scroll distance is supposed to be similar between every scroll area in existence, so users can predict how much scrolling they need to do to see the + * part of the view they are interested in. We try to conform to the global scroll distance setting which is defined through + * QApplication::wheelScrollLines. A single line is assumed to be the height of the default font. This single step is what is supposed to be returned here. + * The issue is that the application the user scrolls in the most (Firefox) does not care about our scroll speed and goes considerably faster. So we + * amend a random times two (* 2) so users are happy with the scroll speed in Dolphin. + */ const QFontMetrics metrics(font()); - return metrics.height(); + return metrics.height() * 2; } qreal KItemListView::verticalPageStep() const |
