1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:27:45 +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

@ -26,6 +26,7 @@ public:
WSMenu* current_menu() { return m_current_menu.ptr(); }
void set_current_menu(WSMenu*, bool is_submenu = false);
void close_bar();
void close_everyone();
void close_everyone_not_in_lineage(WSMenu&);
void close_menu_and_descendants(WSMenu&);
@ -49,5 +50,6 @@ private:
WeakPtr<WSMenu> m_current_menu;
Vector<WeakPtr<WSMenu>> m_open_menu_stack;
bool m_needs_window_resize;
bool m_needs_window_resize { false };
bool m_bar_open { false };
};