1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibGUI: Implement automatic scrolling in AbstractView

This adds automatic scrolling when dragging items in TreeViews and other
widgets that inherit from AbstractView when the overloaded
accepts_drag() returns true. This is implemented in FileSystemModel to
allow directories and files to be dragged.
This commit is contained in:
Marcus Nilsson 2021-09-19 21:31:19 +02:00 committed by Andreas Kling
parent 53cfc6ec9f
commit d660e86d13
6 changed files with 45 additions and 7 deletions

View file

@ -52,7 +52,7 @@ public:
void scroll_to_bottom();
void set_automatic_scrolling_timer(bool active);
Gfx::IntPoint automatic_scroll_delta_from_position(const Gfx::IntPoint&) const;
virtual Gfx::IntPoint automatic_scroll_delta_from_position(const Gfx::IntPoint&) const;
int width_occupied_by_vertical_scrollbar() const;
int height_occupied_by_horizontal_scrollbar() const;
@ -75,6 +75,7 @@ protected:
void set_content_size(const Gfx::IntSize&);
void set_size_occupied_by_fixed_elements(const Gfx::IntSize&);
virtual void on_automatic_scrolling_timer_fired() {};
int autoscroll_threshold() const { return m_autoscroll_threshold; }
private:
class AbstractScrollableWidgetScrollbar final : public Scrollbar {