mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:37:45 +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:
parent
fe47e66438
commit
a5e149c012
2 changed files with 8 additions and 0 deletions
|
@ -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:
|
private:
|
||||||
void layout_menu(Menu&, Gfx::IntRect window_rect);
|
void layout_menu(Menu&, Gfx::IntRect window_rect);
|
||||||
|
|
||||||
|
|
|
@ -2080,6 +2080,7 @@ void WindowManager::invalidate_after_theme_or_font_change()
|
||||||
for_each_window_stack([&](auto& window_stack) {
|
for_each_window_stack([&](auto& window_stack) {
|
||||||
window_stack.for_each_window([&](Window& window) {
|
window_stack.for_each_window([&](Window& window) {
|
||||||
window.frame().theme_changed();
|
window.frame().theme_changed();
|
||||||
|
window.menubar().font_changed(window.rect());
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
});
|
});
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue