1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

LibGUI: Add AbstractView::move_cursor() and share some movement logic

A view can now be told to move its cursor in one of multiple directions
as specified by the CursorMovement enum.

View subclasses can override move_cursor(CursorMovement) to implement
their own cursor behavior. By default, AbstractView::move_cursor() is
a no-op.

This patch improves code sharing between TableView and TreeView. :^)
This commit is contained in:
Andreas Kling 2020-08-27 17:47:19 +02:00
parent 1b3169f405
commit 0b9d765f6b
7 changed files with 154 additions and 55 deletions

View file

@ -96,6 +96,7 @@ protected:
virtual void mousedown_event(MouseEvent&) override;
virtual void doubleclick_event(MouseEvent&) override;
virtual void context_menu_event(ContextMenuEvent&) override;
virtual void keydown_event(KeyEvent&) override;
virtual void resize_event(ResizeEvent&) override;
virtual void did_update_model(unsigned flags) override;