mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 21:54: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
|
Optional<UISize> TextEditor::calculated_min_size() const
|
||||||
{
|
{
|
||||||
auto margins = content_margins();
|
if (is_multi_line())
|
||||||
int horizontal = margins.left() + margins.right(),
|
return AbstractScrollableWidget::calculated_min_size();
|
||||||
vertical = margins.top() + margins.bottom();
|
auto m = content_margins();
|
||||||
int vertical_content_size = font().glyph_height() + 4;
|
return UISize { m.left() + m.right(), m.top() + m.bottom() };
|
||||||
if (!is_multi_line() && m_icon)
|
|
||||||
vertical_content_size = max(vertical_content_size, icon_size() + 2);
|
|
||||||
return UISize(horizontal, vertical);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditor::select_all()
|
void TextEditor::select_all()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue