mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 17:15:26 +00:00
GInputBox: Use whichever is greater: the approximate size of the title, or the label's text
Might be an idea to add a minimum size constrain in window server instead, since it knows the exact dimensions? But this is a simple fix that seems to do the job.
This commit is contained in:
committed by
Andreas Kling
parent
77dfd419e9
commit
20e55c0120
@@ -23,8 +23,10 @@ void GInputBox::build()
|
||||
set_main_widget(widget);
|
||||
|
||||
int text_width = widget->font().width(m_prompt);
|
||||
int title_width = widget->font().width(title()) + 24 /* icon, plus a little padding -- not perfect */;
|
||||
int max_width = AK::max(text_width, title_width);
|
||||
|
||||
set_rect(x(), y(), text_width + 80, 80);
|
||||
set_rect(x(), y(), max_width + 80, 80);
|
||||
|
||||
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
widget->set_fill_with_background_color(true);
|
||||
|
||||
Reference in New Issue
Block a user