mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
FileManager: Silence the "not found" error when setting no wallpaper
If we're setting the path to "" then we can just set the wallpaper to nullptr and carry on with our day. :^)
This commit is contained in:
parent
f0ab127a41
commit
81fe2ef178
Notes:
sideshowbarker
2024-07-17 22:01:16 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/81fe2ef178 Pull-request: https://github.com/SerenityOS/serenity/pull/16360
1 changed files with 4 additions and 0 deletions
|
@ -540,6 +540,10 @@ ErrorOr<int> run_in_desktop_mode()
|
|||
virtual void config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value) override
|
||||
{
|
||||
if (domain == "WindowManager" && group == "Background" && key == "Wallpaper") {
|
||||
if (value.is_empty()) {
|
||||
GUI::Desktop::the().set_wallpaper(nullptr, {});
|
||||
return;
|
||||
}
|
||||
auto wallpaper_bitmap_or_error = Gfx::Bitmap::try_load_from_file(value);
|
||||
if (wallpaper_bitmap_or_error.is_error())
|
||||
dbgln("Failed to load wallpaper bitmap from path: {}", wallpaper_bitmap_or_error.error());
|
||||
|
|
Loading…
Reference in a new issue