diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-26 15:54:03 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-26 17:00:40 +0200 |
commit | 447b65bf7ba035d7c321d1046c6a42b97dd71fbb (patch) | |
tree | 04bfe21d0301d6dcdc8951399bbe6dbded11e0f6 /Libraries/LibGUI/AbstractTableView.h | |
parent | 49a5038a1aca68b766805788f8e28e22372d91fb (diff) | |
download | serenity-447b65bf7ba035d7c321d1046c6a42b97dd71fbb.zip |
LibGUI: Add (optional) row headers to GUI::TableView
You can now get row headers in your TableView by simply calling:
table_view.row_header().set_visible(true)
Note that rows are not yet resizable.
Diffstat (limited to 'Libraries/LibGUI/AbstractTableView.h')
-rw-r--r-- | Libraries/LibGUI/AbstractTableView.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Libraries/LibGUI/AbstractTableView.h b/Libraries/LibGUI/AbstractTableView.h index 318d56e1f3..34ca3b4950 100644 --- a/Libraries/LibGUI/AbstractTableView.h +++ b/Libraries/LibGUI/AbstractTableView.h @@ -82,6 +82,12 @@ public: virtual void did_scroll() override; + HeaderView& column_header() { return *m_column_header; } + const HeaderView& column_header() const { return *m_column_header; } + + HeaderView& row_header() { return *m_row_header; } + const HeaderView& row_header() const { return *m_row_header; } + protected: virtual ~AbstractTableView() override; AbstractTableView(); @@ -96,15 +102,16 @@ protected: void update_content_size(); virtual void update_column_sizes(); + virtual void update_row_sizes(); virtual int item_count() const; TableCellPaintingDelegate* column_painting_delegate(int column) const; - HeaderView& column_header() { return *m_column_header; } - const HeaderView& column_header() const { return *m_column_header; } - private: + void layout_headers(); + RefPtr<HeaderView> m_column_header; + RefPtr<HeaderView> m_row_header; HashMap<int, OwnPtr<TableCellPaintingDelegate>> m_column_painting_delegate; |