LibGUI: Fix row_rect(int) calculation in AbstractTableView

Previously, it didn't take into account the visibility of
column headers.
This commit is contained in:
Itamar 2020-09-20 09:14:52 +03:00 committed by Andreas Kling
parent e3e5e57fde
commit 32d0d00ab2
Notes: sideshowbarker 2024-07-19 02:19:39 +09:00

View file

@ -289,7 +289,10 @@ Gfx::IntRect AbstractTableView::content_rect(const ModelIndex& index) const
Gfx::IntRect AbstractTableView::row_rect(int item_index) const
{
return { row_header().is_visible() ? row_header().width() : 0, column_header().height() + (item_index * row_height()), max(content_size().width(), width()), row_height() };
return { row_header().is_visible() ? row_header().width() : 0,
(column_header().is_visible() ? column_header().height() : 0) + (item_index * row_height()),
max(content_size().width(), width()),
row_height() };
}
Gfx::IntPoint AbstractTableView::adjusted_position(const Gfx::IntPoint& position) const