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:
Andreas Kling 2019-08-17 14:56:53 +02:00
parent 5f6b6c1665
commit 8031960541

View file

@ -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 {};
}