summaryrefslogtreecommitdiff
path: root/LibGUI/GTableView.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-06-30 08:13:41 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-06-30 08:15:55 +0200
commitb8ef5b58044ee12d3b9e70a35a434f175c682957 (patch)
tree5117935570d7713cc4e75c83a1952529501da2cc /LibGUI/GTableView.h
parentce0b615bef6cd572114fe4102c0b8326ad94a575 (diff)
downloadserenity-b8ef5b58044ee12d3b9e70a35a434f175c682957.zip
GTableView: Support per-index context menus.
This patch adds an on_context_menu_request hook to GAbstractView which is currently only invoked by GTableView. We also pass along the entire context menu event, so that anyone using the hook can use it for menu placement etc.
Diffstat (limited to 'LibGUI/GTableView.h')
-rw-r--r--LibGUI/GTableView.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/LibGUI/GTableView.h b/LibGUI/GTableView.h
index 3f63f94aab..6c6b02fa99 100644
--- a/LibGUI/GTableView.h
+++ b/LibGUI/GTableView.h
@@ -30,7 +30,7 @@ public:
bool is_column_hidden(int) const;
void set_column_hidden(int, bool);
- Point adjusted_position(const Point&);
+ Point adjusted_position(const Point&) const;
virtual Rect content_rect(const GModelIndex&) const override;
@@ -47,6 +47,8 @@ private:
virtual void leave_event(CEvent&) override;
virtual void context_menu_event(GContextMenuEvent&) override;
+ GModelIndex index_at_event_position(const Point&) const;
+
Rect content_rect(int row, int column) const;
void paint_headers(Painter&);
int item_count() const;