1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 11:57:35 +00:00

DisplaySettings: Allow setting wallpapers from outside /res/wallpapers

Ideally, we would copy the file to `/res/wallpapers`, add an entry to
`ComboBox` model and set the index to this entry. I didn't want to
touch anything outside of `DisplaySettings`, so this is more of a
workaround :^)
This commit is contained in:
devashish 2020-06-27 14:34:43 +05:30 committed by Andreas Kling
parent 3a4e121904
commit 9f58624802
3 changed files with 14 additions and 5 deletions

View file

@ -33,10 +33,14 @@ MonitorWidget::MonitorWidget()
m_monitor_rect = { 8, 9, 320, 180 };
}
void MonitorWidget::set_wallpaper(String path)
bool MonitorWidget::set_wallpaper(String path)
{
m_desktop_wallpaper_path = path;
m_desktop_wallpaper_bitmap = Gfx::Bitmap::load_from_file(path);
auto bitmap_ptr = Gfx::Bitmap::load_from_file(path);
if (!bitmap_ptr)
return false;
m_desktop_wallpaper_bitmap = bitmap_ptr;
return true;
}
String MonitorWidget::wallpaper()