WheelHandler: smooth scroll for a greater variety of movement sizes

WheelHandler: smooth scroll for a greater variety of movement sizes

Duration is based on the duration and movement for 120 angle delta.

Shorten duration for smaller movements, limit duration for big movements.

We don't want fine deltas to feel extra slow and fast scrolling should still feel fast.

Minimum 3 frames for a 60hz display if delta > 2 physical pixels (start already rendered -> 1/3 rendered -> 2/3 rendered -> end rendered).

Skip animation if <= 2 real frames for low refresh rate screens.

Otherwise, we don't scale the duration based on refresh rate or device pixel ratio to avoid making the animation unexpectedly longer or shorter on different screens.

BUG: 484309

tst_scrolling.qml: don't set default angle delta to verticalStepSize, don't test if smooth scrolling is enabled when testing angle delta moves

While arbitrary angle deltas are allowed, setting the default angle delta size to verticalStepSize is not semantically correct because verticalStepSize is not an angle delta.

We shouldn't make more assumptions about WheelHandler's internal logic than necessary since there is already a way to avoid failing the test when smooth scrolling is enabled.

Edited by Noah Davis

Merge request reports

Loading
Loading