1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:35:07 +00:00

WindowManager: Simplify menu bar open/close logic

Let the global menu bar be either "open" or "closed". Clicking on one
of the menus in the menu bar toggles the state.

This ends up simpler and more intuitive than what we had before.
This commit is contained in:
Andreas Kling 2019-11-11 12:54:23 +01:00
parent cbecad0a77
commit 5e61fd0e67
4 changed files with 18 additions and 8 deletions

View file

@ -731,7 +731,7 @@ void WSWindowManager::process_mouse_event(WSMouseEvent& event, WSWindow*& hovere
if (topmost_menu->hovered_item())
topmost_menu->clear_hovered_item();
if (event.type() == WSEvent::MouseDown || event.type() == WSEvent::MouseUp)
m_menu_manager.close_everyone();
m_menu_manager.close_bar();
if (event.type() == WSEvent::MouseMove) {
for (auto& menu : m_menu_manager.open_menu_stack()) {
if (!menu)