mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 22:44:58 +00:00
LibGUI: Update calculated_min_size() for TextEditor
Defer to AbstractScrollableWidget when TextEditor is multi-line. Otherwise, as "vertical_content_size" was unused, simply return margins for now.
This commit is contained in:
parent
961a225316
commit
901b80f988
1 changed files with 4 additions and 7 deletions
|
@ -754,13 +754,10 @@ void TextEditor::paint_event(PaintEvent& event)
|
|||
|
||||
Optional<UISize> TextEditor::calculated_min_size() const
|
||||
{
|
||||
auto margins = content_margins();
|
||||
int horizontal = margins.left() + margins.right(),
|
||||
vertical = margins.top() + margins.bottom();
|
||||
int vertical_content_size = font().glyph_height() + 4;
|
||||
if (!is_multi_line() && m_icon)
|
||||
vertical_content_size = max(vertical_content_size, icon_size() + 2);
|
||||
return UISize(horizontal, vertical);
|
||||
if (is_multi_line())
|
||||
return AbstractScrollableWidget::calculated_min_size();
|
||||
auto m = content_margins();
|
||||
return UISize { m.left() + m.right(), m.top() + m.bottom() };
|
||||
}
|
||||
|
||||
void TextEditor::select_all()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue