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

LibGUI: Invalidate IconView cache on font change

Changing the font means we have to recalculate all the item rects etc.
This commit is contained in:
Andreas Kling 2023-02-01 23:27:09 +01:00
parent ff0766056b
commit dd607fc619
2 changed files with 9 additions and 0 deletions

View file

@ -59,6 +59,12 @@ void IconView::resize_event(ResizeEvent& event)
}
}
void IconView::did_change_font()
{
AbstractView::did_change_font();
rebuild_item_cache();
}
void IconView::rebuild_item_cache() const
{
auto prev_item_count = m_item_data_cache.size();