mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
Spreadsheet: Add function for moving cursor
This function allows to access cursor movement functionality outside of SpreadsheetView class.
This commit is contained in:
parent
e8579ed24a
commit
cf91815654
Notes:
sideshowbarker
2024-07-18 10:29:41 +09:00
Author: https://github.com/zawwwu 🔰
Commit: cf91815654
Pull-request: https://github.com/SerenityOS/serenity/pull/8433
Reviewed-by: https://github.com/alimpfard
2 changed files with 7 additions and 0 deletions
|
@ -315,6 +315,11 @@ void SpreadsheetView::show_event(GUI::ShowEvent&)
|
|||
}
|
||||
}
|
||||
|
||||
void SpreadsheetView::move_cursor(GUI::AbstractView::CursorMovement direction)
|
||||
{
|
||||
m_table_view->move_cursor(direction, GUI::AbstractView::SelectionUpdate::Set);
|
||||
}
|
||||
|
||||
void SpreadsheetView::TableCellPainter::paint(GUI::Painter& painter, const Gfx::IntRect& rect, const Gfx::Palette& palette, const GUI::ModelIndex& index)
|
||||
{
|
||||
// Draw a border.
|
||||
|
|
|
@ -100,6 +100,8 @@ public:
|
|||
Function<void(Vector<Position>&&)> on_selection_changed;
|
||||
Function<void()> on_selection_dropped;
|
||||
|
||||
void move_cursor(GUI::AbstractView::CursorMovement);
|
||||
|
||||
private:
|
||||
virtual void hide_event(GUI::HideEvent&) override;
|
||||
virtual void show_event(GUI::ShowEvent&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue