mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +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)
|
void ProcessView::mousedown_event(GMouseEvent& event)
|
||||||
{
|
{
|
||||||
|
auto adjusted_position = event.position().translated(0, m_scrollbar->value());
|
||||||
if (event.button() == GMouseButton::Left) {
|
if (event.button() == GMouseButton::Left) {
|
||||||
for (int i = 0; i < item_count(); ++i) {
|
for (int i = 0; i < item_count(); ++i) {
|
||||||
if (!row_rect(i).contains(event.position()))
|
if (!row_rect(i).contains(adjusted_position))
|
||||||
continue;
|
continue;
|
||||||
m_model->set_selected_index({ i, 0 });
|
m_model->set_selected_index({ i, 0 });
|
||||||
update();
|
update();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue