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

LibGUI: Indicate ItemView drag acceptance with a little rectangle

If an index accepts a drag, we now draw a little rectangle around it
when the drag moves over it.
This commit is contained in:
Andreas Kling 2020-02-13 21:50:50 +01:00
parent f0ae353c9e
commit 2c14e46b96
2 changed files with 29 additions and 0 deletions

View file

@ -63,6 +63,7 @@ private:
virtual void mousemove_event(MouseEvent&) override;
virtual void mouseup_event(MouseEvent&) override;
virtual void keydown_event(KeyEvent&) override;
virtual void drag_move_event(DragEvent&) override;
int item_count() const;
Gfx::Rect item_rect(int item_index) const;
@ -81,6 +82,8 @@ private:
Gfx::Point m_rubber_band_origin;
Gfx::Point m_rubber_band_current;
Vector<ModelIndex> m_rubber_band_remembered_selection;
ModelIndex m_drop_candidate_index;
};
}