mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 21:10:30 +00:00
LibGUI: Implement calculated_min_size() for GlyphMapWidget
This commit is contained in:
parent
c4ac73d073
commit
0f5ce017c5
Notes:
sideshowbarker
2024-07-17 08:43:11 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/0f5ce017c5 Pull-request: https://github.com/SerenityOS/serenity/pull/16566
2 changed files with 9 additions and 0 deletions
|
@ -498,4 +498,12 @@ ErrorOr<void> GlyphMapWidget::set_font(Gfx::Font const& font)
|
|||
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 did_change_font() override;
|
||||
virtual void context_menu_event(ContextMenuEvent&) override;
|
||||
virtual Optional<UISize> calculated_min_size() const override;
|
||||
|
||||
Gfx::IntRect get_outer_rect(int glyph) const;
|
||||
Optional<int> glyph_at_position(Gfx::IntPoint) const;
|
||||
|
|
Loading…
Reference in a new issue