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:
parent
14fe7283e1
commit
75dc94064d
3 changed files with 20 additions and 35 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue