mirror of
https://github.com/RGBCube/serenity
synced 2025-06-15 09:42:10 +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:
parent
0c1bc91e88
commit
27cb91e3e0
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue