LibGUI: Implement calculated_min_size() for DialogButton

Dialog buttons now scale based on presentation size to accomodate
larger fonts while retaining uniform widths. Scaling by 8 is
arbitrary but preserves the historical 80 pixel width with Katica 10.
This needs improvement but works well for most fonts as a start.
This commit is contained in:
thankyouverycool 2023-04-14 08:54:06 -04:00 committed by Andreas Kling
commit 479e67212a
Notes: sideshowbarker 2024-07-17 04:32:07 +09:00
2 changed files with 14 additions and 1 deletions

View file

@ -95,8 +95,11 @@ public:
explicit DialogButton(String text = {})
: Button(move(text))
{
set_fixed_width(80);
set_min_size({ SpecialDimension::Shrink });
set_preferred_size({ SpecialDimension::Shrink });
}
virtual Optional<UISize> calculated_min_size() const override;
};
}