mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 09:08:10 +00:00
DisplaySettings: Allow deselection of background image
Previously, if you selected a background image you could not revert to a solid color background.
This commit is contained in:
parent
6048e245ee
commit
1d959a7b81
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue