mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
LibGUI: Use default Button and TextBox heights in InputBox
This commit is contained in:
parent
7a1a8d267d
commit
c098a6495b
1 changed files with 2 additions and 5 deletions
|
@ -47,7 +47,7 @@ void InputBox::build(InputType input_type)
|
|||
int title_width = widget.font().width(title()) + 24 /* icon, plus a little padding -- not perfect */;
|
||||
int max_width = max(text_width, title_width);
|
||||
|
||||
set_rect(x(), y(), max_width + 140, 62);
|
||||
set_rect(x(), y(), max_width + 140, 66);
|
||||
|
||||
widget.set_layout<VerticalBoxLayout>();
|
||||
widget.set_fill_with_background_color(true);
|
||||
|
@ -70,14 +70,13 @@ void InputBox::build(InputType input_type)
|
|||
break;
|
||||
}
|
||||
|
||||
m_text_editor->set_fixed_height(19);
|
||||
m_text_editor->set_text(m_text_value);
|
||||
|
||||
if (!m_placeholder.is_null())
|
||||
m_text_editor->set_placeholder(m_placeholder);
|
||||
|
||||
auto& button_container_outer = widget.add<Widget>();
|
||||
button_container_outer.set_fixed_height(20);
|
||||
button_container_outer.set_fixed_height(22);
|
||||
button_container_outer.set_layout<VerticalBoxLayout>();
|
||||
|
||||
auto& button_container_inner = button_container_outer.add<Widget>();
|
||||
|
@ -87,7 +86,6 @@ void InputBox::build(InputType input_type)
|
|||
button_container_inner.layout()->add_spacer();
|
||||
|
||||
m_ok_button = button_container_inner.add<Button>();
|
||||
m_ok_button->set_fixed_height(20);
|
||||
m_ok_button->set_text("OK");
|
||||
m_ok_button->on_click = [this](auto) {
|
||||
dbgln("GUI::InputBox: OK button clicked");
|
||||
|
@ -96,7 +94,6 @@ void InputBox::build(InputType input_type)
|
|||
};
|
||||
|
||||
m_cancel_button = button_container_inner.add<Button>();
|
||||
m_cancel_button->set_fixed_height(20);
|
||||
m_cancel_button->set_text("Cancel");
|
||||
m_cancel_button->on_click = [this](auto) {
|
||||
dbgln("GUI::InputBox: Cancel button clicked");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue