summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorJagger De Leo <jcdl@fastmail.com>2021-05-21 12:27:12 -0400
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-05-21 21:17:30 +0430
commit1d959a7b814a633f935c0970dc89958584d9bbc4 (patch)
treeb51392aef46b0778041a42444bf1106a77b4da3a /Userland/Applications
parent6048e245ee807f5520685d0e4751059676e24ed1 (diff)
downloadserenity-1d959a7b814a633f935c0970dc89958584d9bbc4.zip
DisplaySettings: Allow deselection of background image
Previously, if you selected a background image you could not revert to a solid color background.
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/DisplaySettings/MonitorWidget.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Applications/DisplaySettings/MonitorWidget.cpp b/Userland/Applications/DisplaySettings/MonitorWidget.cpp
index ef1fa86d03..56096e58bf 100644
--- a/Userland/Applications/DisplaySettings/MonitorWidget.cpp
+++ b/Userland/Applications/DisplaySettings/MonitorWidget.cpp
@@ -26,13 +26,13 @@ MonitorWidget::MonitorWidget()
bool MonitorWidget::set_wallpaper(String path)
{
- if (path.is_empty())
+ if (path == m_desktop_wallpaper_path)
return false;
+
auto bitmap = Gfx::Bitmap::load_from_file(path);
- if (!bitmap)
- return false;
+ if (bitmap)
+ m_wallpaper_bitmap = move(bitmap);
m_desktop_wallpaper_path = move(path);
- m_wallpaper_bitmap = move(bitmap);
m_desktop_dirty = true;
update();
return true;