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:
Jesse Buhagiar 2021-05-29 21:34:36 +10:00 committed by Linus Groh
parent 90e9d1a0a1
commit e2989424c7
Notes: sideshowbarker 2024-07-18 17:13:56 +09:00

View file

@ -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);