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

GItemView: Add context menu support

Also, use the model_column() internally for selection as well as for
painting to keep things consistent.

Note that we always fire the on_context_menu_request hook, even if you
didn't click on an item. In those cases, you get a GModelIndex().
This commit is contained in:
Andreas Kling 2019-09-13 21:41:29 +02:00
parent 69365ccdd0
commit bf23f1e8bc
2 changed files with 43 additions and 14 deletions

View file

@ -30,9 +30,11 @@ private:
virtual void mousedown_event(GMouseEvent&) override;
virtual void keydown_event(GKeyEvent&) override;
virtual void doubleclick_event(GMouseEvent&) override;
virtual void context_menu_event(GContextMenuEvent&) override;
int item_count() const;
Rect item_rect(int item_index) const;
int item_at_event_position(const Point&) const;
void update_content_size();
int m_horizontal_padding { 5 };