mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 16:25:08 +00:00
ProcessManager: Use a scrollbar-adjusted position for hit testing.
This commit is contained in:
parent
c49ceb5a1f
commit
b3ae1163ef
1 changed files with 2 additions and 1 deletions
|
@ -61,9 +61,10 @@ Rect ProcessView::row_rect(int item_index) const
|
|||
|
||||
void ProcessView::mousedown_event(GMouseEvent& event)
|
||||
{
|
||||
auto adjusted_position = event.position().translated(0, m_scrollbar->value());
|
||||
if (event.button() == GMouseButton::Left) {
|
||||
for (int i = 0; i < item_count(); ++i) {
|
||||
if (!row_rect(i).contains(event.position()))
|
||||
if (!row_rect(i).contains(adjusted_position))
|
||||
continue;
|
||||
m_model->set_selected_index({ i, 0 });
|
||||
update();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue