1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:17:35 +00:00

FontEditor: Hide Widget::set_font() in GlyphEditorWidget

We were already doing the same for its getters, and this makes its
API more consistent with GlyphMapWidget.
This commit is contained in:
thankyouverycool 2022-07-05 05:53:36 -04:00 committed by Andreas Kling
parent bae36a7264
commit dcf6454059
3 changed files with 3 additions and 4 deletions

View file

@ -553,7 +553,7 @@ ErrorOr<void> FontEditorWidget::initialize(String const& path, RefPtr<Gfx::Bitma
m_preview_label->set_font(*m_edited_font); m_preview_label->set_font(*m_edited_font);
m_glyph_map_widget->set_font(*m_edited_font); m_glyph_map_widget->set_font(*m_edited_font);
m_glyph_editor_widget->initialize(*m_edited_font); m_glyph_editor_widget->set_font(*m_edited_font);
m_glyph_editor_widget->set_fixed_size(m_glyph_editor_widget->preferred_width(), m_glyph_editor_widget->preferred_height()); m_glyph_editor_widget->set_fixed_size(m_glyph_editor_widget->preferred_width(), m_glyph_editor_widget->preferred_height());
m_glyph_editor_width_spinbox->set_visible(!m_edited_font->is_fixed_width()); m_glyph_editor_width_spinbox->set_visible(!m_edited_font->is_fixed_width());

View file

@ -18,7 +18,7 @@ REGISTER_WIDGET(FontEditor, GlyphEditorWidget);
namespace FontEditor { namespace FontEditor {
void GlyphEditorWidget::initialize(Gfx::BitmapFont& mutable_font) void GlyphEditorWidget::set_font(Gfx::BitmapFont& mutable_font)
{ {
if (m_font == mutable_font) if (m_font == mutable_font)
return; return;

View file

@ -28,8 +28,6 @@ public:
virtual ~GlyphEditorWidget() override = default; virtual ~GlyphEditorWidget() override = default;
void initialize(Gfx::BitmapFont&);
int glyph() const { return m_glyph; } int glyph() const { return m_glyph; }
void set_glyph(int); void set_glyph(int);
bool is_glyph_empty(); bool is_glyph_empty();
@ -43,6 +41,7 @@ public:
Gfx::BitmapFont& font() { return *m_font; } Gfx::BitmapFont& font() { return *m_font; }
Gfx::BitmapFont const& font() const { return *m_font; } Gfx::BitmapFont const& font() const { return *m_font; }
void set_font(Gfx::BitmapFont&);
int scale() const { return m_scale; } int scale() const { return m_scale; }
void set_scale(int scale); void set_scale(int scale);