summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-28 14:28:08 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-29 10:25:45 +0000
commit002112e80516a29efbb6cef721d74c5fc39fc19d (patch)
treedd7458a6b0127c50e50d47ea1f36056554d09eb1 /src
parentc55bdc271fd4014f0bdb314840d89ceb02d6fc40 (diff)
Fix scroll regression near scroll-view ends
Fix regression in a7b0cb467ca5c4a9447d049910c9e3f0abc5897c which caused it to be hard to start scrolling at the ends of a scroll-view if using fine grained scrolling events. Change-Id: I55f3210150b993281545c3ad5a7356d892fa30b5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qabstractslider.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp
index 92d2ffde2b..d818d0b6a9 100644
--- a/src/widgets/widgets/qabstractslider.cpp
+++ b/src/widgets/widgets/qabstractslider.cpp
@@ -723,9 +723,10 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb
if (stepsToScroll == 0) {
// We moved less than a line, but might still have accumulated partial scroll,
// unless we already are at one of the ends.
- if (offset_accumulated > 0.f && value < maximum)
+ const float effective_offset = invertedControls ? -offset_accumulated : offset_accumulated;
+ if (effective_offset > 0.f && value < maximum)
return true;
- if (offset_accumulated < 0.f && value > minimum)
+ if (effective_offset < 0.f && value > minimum)
return true;
offset_accumulated = 0;
return false;