mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibGUI: Support setting an in memory theme in AbstractThemePreview
This commit is contained in:
committed by
Linus Groh
parent
ef7fbbcf70
commit
c76c3e38e6
@@ -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();
|
||||
|
||||
@@ -25,6 +25,7 @@ public:
|
||||
Gfx::Palette const& preview_palette() const { return m_preview_palette; }
|
||||
void set_preview_palette(Gfx::Palette const&);
|
||||
void set_theme_from_file(Core::File&);
|
||||
void set_theme(Core::AnonymousBuffer const&);
|
||||
|
||||
void paint_window(StringView title, Gfx::IntRect const& rect, Gfx::WindowTheme::WindowState, Gfx::Bitmap const& icon, int button_count = 3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user