mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
GTableView: Fix row selection when clicking between two cells
We should still select the entire row when you click between two cells.
This commit is contained in:
parent
5f6b6c1665
commit
8031960541
1 changed files with 2 additions and 1 deletions
|
@ -86,7 +86,7 @@ Rect GTableView::content_rect(int row, int column) const
|
|||
for (int i = 0; i < column; ++i)
|
||||
x += column_width(i) + horizontal_padding() * 2;
|
||||
|
||||
return { horizontal_padding() + row_rect.x() + x, row_rect.y(), column_width(column), item_height() };
|
||||
return { row_rect.x() + x, row_rect.y(), column_width(column) + horizontal_padding() * 2, item_height() };
|
||||
}
|
||||
|
||||
Rect GTableView::content_rect(const GModelIndex& index) const
|
||||
|
@ -190,6 +190,7 @@ GModelIndex GTableView::index_at_event_position(const Point& position) const
|
|||
continue;
|
||||
return model()->index(row, column);
|
||||
}
|
||||
return model()->index(row, 0);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue