1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 03:05:06 +00:00

LibGUI: Unbreak clearing GTableView selection by clicking outside items.

Also, clicking on the column headers should not clear selection.
This commit is contained in:
Andreas Kling 2019-03-04 10:18:05 +01:00
parent ef4d517429
commit f91a20f9d0
2 changed files with 6 additions and 5 deletions

View file

@ -87,6 +87,11 @@ Rect GTableView::row_rect(int item_index) const
void GTableView::mousedown_event(GMouseEvent& event)
{
if (event.y() < header_height()) {
// FIXME: Do something when clicking on a header.
return;
}
auto adjusted_position = event.position().translated(0, m_vertical_scrollbar->value());
if (event.button() == GMouseButton::Left) {
for (int i = 0; i < item_count(); ++i) {