1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +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

@ -38,6 +38,8 @@ bool MultiScaleBitmaps::load(StringView const& filename, StringView const& defau
Optional<Gfx::BitmapFormat> bitmap_format;
bool did_load_any = false;
m_bitmaps.clear(); // If we're reloading the bitmaps get rid of the old ones
auto add_bitmap = [&](StringView const& path, int scale_factor) {
auto bitmap = Gfx::Bitmap::load_from_file(path, scale_factor);
if (bitmap) {