1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

LibGUI: Move index_at_event_position() up to GAbstractView

It's now an abstract (pure virtual) public method in GAbstractView that
individual widgets have to implement. This will allow us to move more
selection-related logic into GAbstractView in order to share it between
implementations.
This commit is contained in:
Sergey Bugaev 2020-01-22 18:13:01 +03:00 committed by Andreas Kling
parent ff66101f9e
commit 91d3fc54be
6 changed files with 16 additions and 5 deletions

View file

@ -48,6 +48,8 @@ public:
int model_column() const { return m_model_column; }
void set_model_column(int column) { m_model_column = column; }
virtual GModelIndex index_at_event_position(const Point&) const override;
private:
explicit GItemView(GWidget* parent);
@ -64,7 +66,6 @@ private:
int item_count() const;
Rect item_rect(int item_index) const;
GModelIndex index_at_event_position(const Point&) const;
Vector<int> items_intersecting_rect(const Rect&) const;
void update_content_size();
void get_item_rects(int item_index, const Font&, const GVariant& item_text, Rect& item_rect, Rect& icon_rect, Rect& text_rect) const;