From 4da327d650af76f8541dd5a2509d6619ff4846ac Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 13 Dec 2020 11:10:37 +0100 Subject: 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. --- Applications/DisplaySettings/MonitorWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Applications/DisplaySettings/MonitorWidget.cpp b/Applications/DisplaySettings/MonitorWidget.cpp index cb83eefcd1..0cd87b9cec 100644 --- a/Applications/DisplaySettings/MonitorWidget.cpp +++ b/Applications/DisplaySettings/MonitorWidget.cpp @@ -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; } -- cgit v1.2.3