diff options
author | MacDue <macdue@dueutil.tech> | 2022-03-08 21:50:42 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-13 11:45:07 +0100 |
commit | 91fff3f1ae599d0d4ce57380b84741a2eb5e0629 (patch) | |
tree | 7dc2ac2ab07aef28709593fb03466d09abbc6660 /Userland/Libraries/LibGUI/Scrollbar.h | |
parent | 9ab3ab86cb061c8dda26718ed3de55a3f142a10a (diff) | |
download | serenity-91fff3f1ae599d0d4ce57380b84741a2eb5e0629.zip |
LibGUI: Allow setting smooth/coarse scrolling animation on ScrollBar
Diffstat (limited to 'Userland/Libraries/LibGUI/Scrollbar.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Scrollbar.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Scrollbar.h b/Userland/Libraries/LibGUI/Scrollbar.h index 3ebbf944af..e5b99185e7 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.h +++ b/Userland/Libraries/LibGUI/Scrollbar.h @@ -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 }; |