1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

WindowServer: Reload icons on scale changes

Since MultiScaleBitmaps only loads icons for the scales in use, we need
to unconditionally reload them so that we pick up the correct bitmaps
for a scale that hasn't been previously used.
This commit is contained in:
Tom 2021-06-19 13:19:18 -06:00 committed by Andreas Kling
parent 14fe7283e1
commit 75dc94064d
3 changed files with 20 additions and 35 deletions

View file

@ -20,10 +20,10 @@ public:
Gfx::Bitmap const& default_bitmap() const { return bitmap(1); }
Gfx::Bitmap const& bitmap(int scale_factor) const;
Gfx::BitmapFormat format() const { return m_format; }
bool load(StringView const& filename, StringView const& default_filename = {});
private:
MultiScaleBitmaps() = default;
bool load(StringView const& filename, StringView const& default_filename);
HashMap<int, NonnullRefPtr<Gfx::Bitmap>> m_bitmaps;
Gfx::BitmapFormat m_format { Gfx::BitmapFormat::Invalid };