mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +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:
parent
cf4ddd1dcf
commit
0ad5e85163
4 changed files with 8 additions and 6 deletions
|
@ -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 {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue