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.
This commit is contained in:
thankyouverycool 2023-04-02 13:26:27 -04:00 committed by Andreas Kling
parent b79b70f197
commit 207409c925
Notes: sideshowbarker 2024-07-16 22:17:03 +09:00

View File

@ -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())