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

WindowManager: Move more of the menu management logic to WSMenuManager

This patch moves a whole lot of the menu logic from WSWindowManager to
its proper home in WSMenuManager.

We also get rid of the "close_current_menu()" concept which was easily
confused in the presence of submenus. All operations should now be
aware of the menu stack instead. (The concept of a single, current menu
made a lot more sense when there were no nested menus.)
This commit is contained in:
Andreas Kling 2019-11-11 12:21:57 +01:00
parent 77de51d251
commit cbecad0a77
7 changed files with 126 additions and 96 deletions

View file

@ -29,6 +29,7 @@ public:
bool is_empty() const { return m_items.is_empty(); }
int item_count() const { return m_items.size(); }
const WSMenuItem& item(int index) const { return m_items.at(index); }
void add_item(NonnullOwnPtr<WSMenuItem>&& item) { m_items.append(move(item)); }