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
commit dd607fc619
Notes: sideshowbarker 2024-07-17 01:13:25 +09:00
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();

View file

@ -46,6 +46,9 @@ public:
virtual void select_all() override;
protected:
virtual void did_change_font() override;
private:
IconView();