1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

WindowServer: Update menu buttons' rects on font change

Prior to this change, after changing the system font, the menu rects
stayed the same, making the menu bar look a bit cramped on larger fonts.
This commit is contained in:
Karol Kosek 2022-03-14 18:20:21 +01:00 committed by Andreas Kling
parent fe47e66438
commit a5e149c012
2 changed files with 8 additions and 0 deletions

View file

@ -56,6 +56,13 @@ public:
}
}
void font_changed(Gfx::IntRect window_rect)
{
m_next_menu_location = { 0, 0 };
for (auto& menu : m_menus)
layout_menu(menu, window_rect);
}
private:
void layout_menu(Menu&, Gfx::IntRect window_rect);

View file

@ -2080,6 +2080,7 @@ void WindowManager::invalidate_after_theme_or_font_change()
for_each_window_stack([&](auto& window_stack) {
window_stack.for_each_window([&](Window& window) {
window.frame().theme_changed();
window.menubar().font_changed(window.rect());
return IterationDecision::Continue;
});
return IterationDecision::Continue;