mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibGUI+Applications: Let GlyphMapWidget initialize a null Font
FontEditor will need to clear references to its mutable font in the future while CharacterMap has no use for the highlights clone, so let's convert GlyphMapWidget's set_font wrapper into a separate initialize function for the editor and stop hiding the base function for others. Setting font null in either ultimately points the map to the system's default font.
This commit is contained in:
committed by
Andreas Kling
parent
cf4ddd1dcf
commit
0ad5e85163
@@ -573,9 +573,12 @@ bool GlyphMapWidget::glyph_is_modified(u32 glyph)
|
||||
return m_modified_glyphs.contains(glyph);
|
||||
}
|
||||
|
||||
ErrorOr<void> GlyphMapWidget::set_font(Gfx::Font const& font)
|
||||
ErrorOr<void> GlyphMapWidget::initialize(Gfx::Font const* font)
|
||||
{
|
||||
m_original_font = TRY(font.try_clone());
|
||||
if (font)
|
||||
m_original_font = TRY(font->try_clone());
|
||||
else
|
||||
m_original_font = nullptr;
|
||||
m_modified_glyphs.clear();
|
||||
AbstractScrollableWidget::set_font(font);
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user