LibGUI: Make GTreeView inherit from GAbstractColumnView

This makes GTreeView able to support multi-column models!

Only one column can be the "tree column", this is column 0 by default
but can be changed by overriding GModel::tree_column().
This commit is contained in:
Andreas Kling 2019-12-13 23:36:36 +01:00
parent b909d991f1
commit 0ac74d3778
Notes: sideshowbarker 2024-07-19 10:52:19 +09:00
7 changed files with 248 additions and 121 deletions
Libraries/LibGUI

View file

@ -35,8 +35,9 @@ void GTableView::paint_event(GPaintEvent& event)
int exposed_width = max(content_size().width(), width());
int y_offset = header_height();
int first_visible_row = index_at_event_position(frame_inner_rect().top_left()).row();
int last_visible_row = index_at_event_position(frame_inner_rect().bottom_right()).row();
bool dummy;
int first_visible_row = index_at_event_position(frame_inner_rect().top_left(), dummy).row();
int last_visible_row = index_at_event_position(frame_inner_rect().bottom_right(), dummy).row();
if (first_visible_row == -1)
first_visible_row = 0;