mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
LibGUI: Add a cursor to AbstractView, separate from the selection
Views now have a cursor index (retrievable via cursor_index()) which is separate from the selection. Until now, we've been using the first entry in the selection as "the cursor", which gets messy whenever you want to select more than one index in the model. When setting the cursor, the selection is implicitly updated as well to maintain the old behavior (for the most part.) Going forward, this will make it much easier to implement things like shift-select (extend selection from cursor) and such. :^)
This commit is contained in:
parent
76a0acb5bc
commit
9cf37901cd
8 changed files with 79 additions and 49 deletions
|
@ -55,7 +55,7 @@ protected:
|
|||
|
||||
virtual void did_update_selection() override;
|
||||
virtual void did_update_model(unsigned flags) override;
|
||||
virtual void move_cursor(CursorMovement) override;
|
||||
virtual void move_cursor(CursorMovement, SelectionUpdate) override;
|
||||
|
||||
private:
|
||||
virtual ModelIndex index_at_event_position(const Gfx::IntPoint&, bool& is_toggle) const override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue