mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
LibGUI: Only repaint the affected indices on AbstractView item hover
Previously, moving the cursor over items in an item view would cause it to repaint itself completely. Now we only repaint the two affected items (the old hovered item and the new hovered item.)
This commit is contained in:
parent
df96380121
commit
b368560800
1 changed files with 6 additions and 1 deletions
|
@ -249,7 +249,12 @@ void AbstractView::set_hovered_index(const ModelIndex& index)
|
|||
auto old_index = m_hovered_index;
|
||||
m_hovered_index = index;
|
||||
did_change_hovered_index(old_index, index);
|
||||
update();
|
||||
|
||||
if (old_index.is_valid())
|
||||
update(to_widget_rect(paint_invalidation_rect(old_index)));
|
||||
|
||||
if (index.is_valid())
|
||||
update(to_widget_rect(paint_invalidation_rect(index)));
|
||||
}
|
||||
|
||||
void AbstractView::leave_event(Core::Event& event)
|
||||
|
|
Loading…
Add table
Reference in a new issue