mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-20 18:18:19 +00:00
WSMenuManager: On menu close, close the currently hovered menu item
Ensure that the current hover is not still hovered when the menu is opened again.
This commit is contained in:
committed by
Andreas Kling
parent
0c1bc91e88
commit
27cb91e3e0
@@ -315,6 +315,7 @@ void WSMenuManager::close_everyone()
|
||||
for (auto& menu : m_open_menu_stack) {
|
||||
if (menu && menu->menu_window())
|
||||
menu->menu_window()->set_visible(false);
|
||||
menu->clear_hovered_item();
|
||||
}
|
||||
m_open_menu_stack.clear();
|
||||
m_current_menu = nullptr;
|
||||
@@ -341,6 +342,7 @@ void WSMenuManager::close_menus(const Vector<WSMenu*>& menus)
|
||||
m_current_menu = nullptr;
|
||||
if (menu->menu_window())
|
||||
menu->menu_window()->set_visible(false);
|
||||
menu->clear_hovered_item();
|
||||
m_open_menu_stack.remove_first_matching([&](auto& entry) {
|
||||
return entry == menu;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user