mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +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:
parent
53cfc6ec9f
commit
d660e86d13
6 changed files with 45 additions and 7 deletions
|
@ -142,6 +142,8 @@ protected:
|
|||
virtual void hide_event(HideEvent&) override;
|
||||
virtual void focusin_event(FocusEvent&) override;
|
||||
|
||||
virtual void on_automatic_scrolling_timer_fired() override;
|
||||
|
||||
virtual void clear_selection();
|
||||
virtual void set_selection(ModelIndex const&);
|
||||
virtual void set_selection_start_index(ModelIndex const&);
|
||||
|
@ -202,6 +204,8 @@ private:
|
|||
bool m_is_dragging { false };
|
||||
bool m_draw_item_text_with_shadow { false };
|
||||
bool m_suppress_update_on_selection_change { false };
|
||||
|
||||
Gfx::IntPoint m_automatic_scroll_delta {};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue