mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibGUI: Support setting an in memory theme in AbstractThemePreview
This commit is contained in:
parent
ef7fbbcf70
commit
c76c3e38e6
Notes:
sideshowbarker
2024-07-17 10:06:45 +09:00
Author: https://github.com/networkException
Commit: c76c3e38e6
Pull-request: https://github.com/SerenityOS/serenity/pull/14305
Reviewed-by: https://github.com/linusg ✅
2 changed files with 8 additions and 0 deletions
|
@ -78,6 +78,13 @@ void AbstractThemePreview::set_preview_palette(Gfx::Palette const& palette)
|
|||
update();
|
||||
}
|
||||
|
||||
void AbstractThemePreview::set_theme(Core::AnonymousBuffer const& theme_buffer)
|
||||
{
|
||||
VERIFY(theme_buffer.is_valid());
|
||||
m_preview_palette = Gfx::Palette(Gfx::PaletteImpl::create_with_anonymous_buffer(theme_buffer));
|
||||
set_preview_palette(m_preview_palette);
|
||||
}
|
||||
|
||||
void AbstractThemePreview::set_theme_from_file(Core::File& file)
|
||||
{
|
||||
auto config_file = Core::ConfigFile::open(file.filename(), file.leak_fd()).release_value_but_fixme_should_propagate_errors();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue