diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2023-04-02 13:26:27 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-04 19:15:15 +0200 |
commit | 207409c925d510cff602f72c692cddf89f2a00e3 (patch) | |
tree | b97339f98888cd7729c45b36722329efbb18446a | |
parent | b79b70f197efcbcb76cebeabc445faa5d73377c2 (diff) | |
download | serenity-207409c925d510cff602f72c692cddf89f2a00e3.zip |
LibGUI: Don't hover AbstractView indicies outside visible content
Fixes ComboBox ListView erroneously setting and scrolling to
indicies just outside its inner rect when mousing along the
bottom or top of the frame.
-rw-r--r-- | Userland/Libraries/LibGUI/AbstractView.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp index 26aa2320e3..cc78fb985b 100644 --- a/Userland/Libraries/LibGUI/AbstractView.cpp +++ b/Userland/Libraries/LibGUI/AbstractView.cpp @@ -291,8 +291,10 @@ void AbstractView::mousemove_event(MouseEvent& event) if (!model()) return AbstractScrollableWidget::mousemove_event(event); - auto hovered_index = index_at_event_position(event.position()); - set_hovered_index(hovered_index); + if (widget_inner_rect().contains(event.position())) { + auto hovered_index = index_at_event_position(event.position()); + set_hovered_index(hovered_index); + } auto data_type = m_model->drag_data_type(); if (data_type.is_null()) |