1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 18:05:07 +00:00

LibGUI: Simplify ListView hover highlighting

Instead of tracking the last valid hovered index, just hook the
mousemove event and make the cursor follow the hover when it changes.
This commit is contained in:
Andreas Kling 2020-09-02 21:21:24 +02:00
parent 274a09246b
commit 4ba12e9c23
5 changed files with 10 additions and 30 deletions

View file

@ -234,16 +234,6 @@ void AbstractView::set_hovered_index(const ModelIndex& index)
if (m_hovered_index == index)
return;
m_hovered_index = index;
if (m_hovered_index.is_valid())
m_last_valid_hovered_index = m_hovered_index;
update();
}
void AbstractView::set_last_valid_hovered_index(const ModelIndex& index)
{
if (m_last_valid_hovered_index == index)
return;
m_last_valid_hovered_index = index;
update();
}