mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 10:19:03 +03: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
Notes:
sideshowbarker
2024-07-18 17:37:42 +09:00
Author: https://github.com/danielledeleo Commit: https://github.com/SerenityOS/serenity/commit/1d959a7b814 Pull-request: https://github.com/SerenityOS/serenity/pull/7351
@ -26,13 +26,13 @@ MonitorWidget::MonitorWidget()
|
|||||||
|
|
||||||
bool MonitorWidget::set_wallpaper(String path)
|
bool MonitorWidget::set_wallpaper(String path)
|
||||||
{
|
{
|
||||||
if (path.is_empty())
|
if (path == m_desktop_wallpaper_path)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
auto bitmap = Gfx::Bitmap::load_from_file(path);
|
auto bitmap = Gfx::Bitmap::load_from_file(path);
|
||||||
if (!bitmap)
|
if (bitmap)
|
||||||
return false;
|
m_wallpaper_bitmap = move(bitmap);
|
||||||
m_desktop_wallpaper_path = move(path);
|
m_desktop_wallpaper_path = move(path);
|
||||||
m_wallpaper_bitmap = move(bitmap);
|
|
||||||
m_desktop_dirty = true;
|
m_desktop_dirty = true;
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user