From 76b2443130955a7a830d06ef23f647950ad48507 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Mon, 1 Sep 2025 18:34:01 +0200 Subject: 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 --- src/kitemviews/kitemlistview.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.3