mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
DisplaySettings: Allow unsetting the wallpaper
It was previously not possible to unset the wallpaper once set, since loading an image from the path "" would always fail.
This commit is contained in:
parent
545ed01e7d
commit
4da327d650
1 changed files with 2 additions and 2 deletions
|
@ -35,10 +35,10 @@ MonitorWidget::MonitorWidget()
|
|||
|
||||
bool MonitorWidget::set_wallpaper(String path)
|
||||
{
|
||||
m_desktop_wallpaper_path = path;
|
||||
auto bitmap_ptr = Gfx::Bitmap::load_from_file(path);
|
||||
if (!bitmap_ptr)
|
||||
if (!bitmap_ptr && !path.is_empty())
|
||||
return false;
|
||||
m_desktop_wallpaper_path = path;
|
||||
m_desktop_wallpaper_bitmap = bitmap_ptr;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue