mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 12:07:45 +00:00
LibGUI: Use new layout system for basic widgets
This commit is contained in:
parent
bfbaad9f41
commit
19fac58e49
17 changed files with 85 additions and 18 deletions
|
@ -21,8 +21,8 @@ RadioButton::RadioButton(String text)
|
|||
{
|
||||
set_exclusive(true);
|
||||
set_checkable(true);
|
||||
set_min_width(32);
|
||||
set_fixed_height(22);
|
||||
set_min_size({ 22, 22 });
|
||||
set_preferred_size({ SpecialDimension::OpportunisticGrow, 22 });
|
||||
}
|
||||
|
||||
Gfx::IntSize RadioButton::circle_size()
|
||||
|
@ -61,4 +61,13 @@ void RadioButton::click(unsigned)
|
|||
set_checked(true);
|
||||
}
|
||||
|
||||
Optional<UISize> RadioButton::calculated_min_size() const
|
||||
{
|
||||
int horizontal = 2 + 7, vertical = 0;
|
||||
auto& font = this->font();
|
||||
vertical = max(font.glyph_height(), circle_size().height());
|
||||
horizontal += font.width(text());
|
||||
return UISize(horizontal, vertical);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue