mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:07:34 +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:
parent
ff0766056b
commit
dd607fc619
2 changed files with 9 additions and 0 deletions
|
@ -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();
|
||||
|
|
|
@ -46,6 +46,9 @@ public:
|
|||
|
||||
virtual void select_all() override;
|
||||
|
||||
protected:
|
||||
virtual void did_change_font() override;
|
||||
|
||||
private:
|
||||
IconView();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue