Use accumulator for seeking via scrolling

This results in much smoother experience on my touchpad.
The value of 120 was chosen as the most common for mice,
according to Qt 6 documentation.
This commit is contained in:
Eri the Switch
2024-07-21 13:14:25 +03:00
committed by Jonas Kvinge
parent 3ecf224d91
commit 3bd0331aa3
2 changed files with 13 additions and 3 deletions

View File

@@ -66,11 +66,16 @@ class TrackSliderSlider : public QSlider {
void UpdateDeltaTime();
private:
// Units are eighths of a degree
static const int WHEEL_ROTATION_TO_SEEK = 120;
#ifndef Q_OS_MACOS
TrackSliderPopup *popup_;
#endif
int mouse_hover_seconds_;
int wheel_accumulator_;
};
#endif // TRACKSLIDERSLIDER_H