mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 02:28:12 +00:00
WindowServer: Redraw window menubars when moving with arrow keys
Also, make sure we don't draw a menu in hovered state while another menu is open. Fixes #5949.
This commit is contained in:
parent
6ae174f80a
commit
dfb81242f3
2 changed files with 7 additions and 2 deletions
|
@ -314,8 +314,11 @@ void WindowFrame::paint_menubar(Gfx::Painter& painter)
|
|||
Color text_color = palette.window_text();
|
||||
if (MenuManager::the().is_open(menu))
|
||||
text_rect.move_by(1, 1);
|
||||
if (&menu == MenuManager::the().hovered_menu() || MenuManager::the().is_open(menu))
|
||||
Gfx::StylePainter::paint_button(painter, menu.rect_in_window_menubar(), palette, Gfx::ButtonStyle::CoolBar, MenuManager::the().is_open(menu), true);
|
||||
bool paint_as_pressed = MenuManager::the().is_open(menu);
|
||||
bool paint_as_hovered = !paint_as_pressed && &menu == MenuManager::the().hovered_menu();
|
||||
if (paint_as_pressed || paint_as_hovered) {
|
||||
Gfx::StylePainter::paint_button(painter, menu.rect_in_window_menubar(), palette, Gfx::ButtonStyle::CoolBar, paint_as_pressed, paint_as_hovered);
|
||||
}
|
||||
painter.draw_text(
|
||||
text_rect,
|
||||
menu.name(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue