1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:28:14 +00:00

LibGUI: Port AbstractThemePreview::set_theme_from_file to Core::Stream

This commit is contained in:
Karol Kosek 2023-01-09 21:05:23 +01:00 committed by Jelle Raaijmakers
parent 17012b266c
commit ca7648b1ae
3 changed files with 5 additions and 5 deletions

View file

@ -85,9 +85,9 @@ void AbstractThemePreview::set_theme(Core::AnonymousBuffer const& theme_buffer)
set_preview_palette(m_preview_palette);
}
ErrorOr<void> AbstractThemePreview::set_theme_from_file(Core::File& file)
ErrorOr<void> AbstractThemePreview::set_theme_from_file(StringView path, NonnullOwnPtr<Core::Stream::File> file)
{
auto config_file = TRY(Core::ConfigFile::open(file.filename(), file.leak_fd()));
auto config_file = TRY(Core::ConfigFile::open(path, move(file)));
auto theme = TRY(Gfx::load_system_theme(config_file));
m_preview_palette = Gfx::Palette(Gfx::PaletteImpl::create_with_anonymous_buffer(theme));