mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:37:44 +00:00
LibGUI: Use the correct font when relayouting Breadcrumbbar
When the system is broadcasting a "system font changed" notification, the Breadcrumbbar will be notified before its button children. This means that we have to use the Breadcrumbbar's font() for calculations inside Breadcrumbbar as the buttons themselves still have the old font at this point.
This commit is contained in:
parent
63ac6ced31
commit
5577d5f789
1 changed files with 3 additions and 1 deletions
|
@ -175,7 +175,9 @@ void Breadcrumbbar::relayout()
|
|||
for (auto& segment : m_segments) {
|
||||
VERIFY(segment.button);
|
||||
auto& button = *segment.button;
|
||||
auto button_text_width = button.font().width(segment.text);
|
||||
// NOTE: We use our own font instead of the button's font here in case we're being notified about
|
||||
// a system font change, and the button hasn't been notified yet.
|
||||
auto button_text_width = font().width(segment.text);
|
||||
auto icon_width = button.icon() ? button.icon()->width() : 0;
|
||||
auto icon_padding = button.icon() ? 4 : 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue