mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
LibGUI: Implement calculated_min_size() for GlyphMapWidget
This commit is contained in:
parent
c4ac73d073
commit
0f5ce017c5
2 changed files with 9 additions and 0 deletions
|
@ -498,4 +498,12 @@ ErrorOr<void> GlyphMapWidget::set_font(Gfx::Font const& font)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Optional<UISize> GlyphMapWidget::calculated_min_size() const
|
||||||
|
{
|
||||||
|
auto scrollbar = vertical_scrollbar().effective_min_size().height().as_int();
|
||||||
|
auto min_height = max(font().glyph_height() + m_vertical_spacing, scrollbar);
|
||||||
|
auto min_width = font().max_glyph_width() + m_horizontal_spacing + width_occupied_by_vertical_scrollbar();
|
||||||
|
return { { min_width + frame_thickness() * 2, min_height + frame_thickness() * 2 } };
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,7 @@ private:
|
||||||
virtual void resize_event(ResizeEvent&) override;
|
virtual void resize_event(ResizeEvent&) override;
|
||||||
virtual void did_change_font() override;
|
virtual void did_change_font() override;
|
||||||
virtual void context_menu_event(ContextMenuEvent&) override;
|
virtual void context_menu_event(ContextMenuEvent&) override;
|
||||||
|
virtual Optional<UISize> calculated_min_size() const override;
|
||||||
|
|
||||||
Gfx::IntRect get_outer_rect(int glyph) const;
|
Gfx::IntRect get_outer_rect(int glyph) const;
|
||||||
Optional<int> glyph_at_position(Gfx::IntPoint) const;
|
Optional<int> glyph_at_position(Gfx::IntPoint) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue