1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +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 void IconView::rebuild_item_cache() const
{ {
auto prev_item_count = m_item_data_cache.size(); auto prev_item_count = m_item_data_cache.size();

View file

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