mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +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
Notes:
sideshowbarker
2024-07-17 02:29:45 +09:00
Author: https://github.com/thankyouverycool
Commit: 0ad5e85163
Pull-request: https://github.com/SerenityOS/serenity/pull/18764
Reviewed-by: https://github.com/caoimhebyrne ✅
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