1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 03:45:08 +00:00

LibGUI: More GInputBox refinements.

Fix some GBoxLayout bugs to make the buttons in GInputBox line up better.
There are still some imperfections due to rounding errors.
This commit is contained in:
Andreas Kling 2019-03-19 03:00:42 +01:00
parent 46577a6948
commit e15cc4509f
3 changed files with 15 additions and 19 deletions

View file

@ -24,7 +24,7 @@ void GInputBox::build()
int text_width = widget->font().width(m_prompt);
set_rect(x(), y(), text_width + 80, 120);
set_rect(x(), y(), text_width + 80, 80);
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
widget->set_fill_with_background_color(true);
@ -41,6 +41,8 @@ void GInputBox::build()
m_text_editor->set_preferred_size({ 0, 16 });
auto* button_container_outer = new GWidget(widget);
button_container_outer->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
button_container_outer->set_preferred_size({ 0, 16 });
button_container_outer->set_layout(make<GBoxLayout>(Orientation::Vertical));
auto* button_container_inner = new GWidget(button_container_outer);