diff options
author | Jesse Buhagiar <jooster669@gmail.com> | 2021-05-29 21:34:36 +1000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-29 13:30:19 +0100 |
commit | e2989424c7e1999823981febbdfa7a4f1c3d34a1 (patch) | |
tree | 70d76c94c9c19ff58b68c2584afe04fec4210a41 /Userland/Applications/DisplaySettings | |
parent | 90e9d1a0a1f9735d5db26c7180d30f66fe97227f (diff) | |
download | serenity-e2989424c7e1999823981febbdfa7a4f1c3d34a1.zip |
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
Diffstat (limited to 'Userland/Applications/DisplaySettings')
-rw-r--r-- | Userland/Applications/DisplaySettings/MonitorWidget.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Applications/DisplaySettings/MonitorWidget.cpp b/Userland/Applications/DisplaySettings/MonitorWidget.cpp index 56096e58bf..dfbfcb6e84 100644 --- a/Userland/Applications/DisplaySettings/MonitorWidget.cpp +++ b/Userland/Applications/DisplaySettings/MonitorWidget.cpp @@ -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); |