mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-14 01:04:38 +03:00
DisplaySettings: Set monitor widget color if no image is selected
The monitor widget now displays the selected colour if no background image has been selected. Resolves #7491
This commit is contained in:
parent
90e9d1a0a1
commit
e2989424c7
Notes:
sideshowbarker
2024-07-18 17:13:56 +09:00
Author: https://github.com/Quaker762 Commit: https://github.com/SerenityOS/serenity/commit/e2989424c7e Pull-request: https://github.com/SerenityOS/serenity/pull/7552 Issue: https://github.com/SerenityOS/serenity/issues/7491
@ -29,6 +29,14 @@ bool MonitorWidget::set_wallpaper(String path)
|
||||
if (path == m_desktop_wallpaper_path)
|
||||
return false;
|
||||
|
||||
if (path.is_empty()) {
|
||||
m_wallpaper_bitmap = nullptr;
|
||||
m_desktop_wallpaper_path = nullptr;
|
||||
m_desktop_dirty = true;
|
||||
update();
|
||||
return false;
|
||||
}
|
||||
|
||||
auto bitmap = Gfx::Bitmap::load_from_file(path);
|
||||
if (bitmap)
|
||||
m_wallpaper_bitmap = move(bitmap);
|
||||
|
Loading…
Reference in New Issue
Block a user