1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:37:34 +00:00

LibGUI: Allow setting smooth/coarse scrolling animation on ScrollBar

This commit is contained in:
MacDue 2022-03-08 21:50:42 +00:00 committed by Andreas Kling
parent 9ab3ab86cb
commit 91fff3f1ae
2 changed files with 17 additions and 0 deletions

View file

@ -23,6 +23,13 @@ public:
bool has_scrubber() const;
enum class Animation {
SmoothScroll,
CoarseScroll
};
void set_scroll_animation(Animation scroll_animation);
virtual void set_value(int, AllowCallback = AllowCallback::Yes) override;
void set_target_value(int);
@ -79,6 +86,8 @@ private:
void update_animated_scroll();
Animation m_scroll_animation { Animation::SmoothScroll };
int m_target_value { 0 };
int m_start_value { 0 };
double m_animation_time_elapsed { 0 };