mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:17:45 +00:00
WindowServer+LibGUI: Add support for nested menus
It's now possible to add a GMenu as a submenu of another GMenu. Simply use the GMenu::add_submenu(NonnullOwnPtr<GMenu>) API :^) The WindowServer now keeps track of a stack of open menus rather than just one "current menu". This code needs a bit more work, but the basic functionality is now here!
This commit is contained in:
parent
d3ebd8897f
commit
63e6b09816
16 changed files with 177 additions and 12 deletions
|
@ -303,7 +303,7 @@ private:
|
|||
|
||||
class WSAPIAddMenuItemRequest : public WSAPIClientRequest {
|
||||
public:
|
||||
WSAPIAddMenuItemRequest(int client_id, int menu_id, unsigned identifier, const String& text, const String& shortcut_text, bool enabled, bool checkable, bool checked, int icon_buffer_id)
|
||||
WSAPIAddMenuItemRequest(int client_id, int menu_id, unsigned identifier, const String& text, const String& shortcut_text, bool enabled, bool checkable, bool checked, int icon_buffer_id, int submenu_id)
|
||||
: WSAPIClientRequest(WSEvent::APIAddMenuItemRequest, client_id)
|
||||
, m_menu_id(menu_id)
|
||||
, m_identifier(identifier)
|
||||
|
@ -313,6 +313,7 @@ public:
|
|||
, m_checkable(checkable)
|
||||
, m_checked(checked)
|
||||
, m_icon_buffer_id(icon_buffer_id)
|
||||
, m_submenu_id(submenu_id)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -324,6 +325,7 @@ public:
|
|||
bool is_checkable() const { return m_checkable; }
|
||||
bool is_checked() const { return m_checked; }
|
||||
int icon_buffer_id() const { return m_icon_buffer_id; }
|
||||
int submenu_id() const { return m_submenu_id; }
|
||||
|
||||
private:
|
||||
int m_menu_id { 0 };
|
||||
|
@ -334,6 +336,7 @@ private:
|
|||
bool m_checkable;
|
||||
bool m_checked;
|
||||
int m_icon_buffer_id { 0 };
|
||||
int m_submenu_id { 0 };
|
||||
};
|
||||
|
||||
class WSAPIUpdateMenuItemRequest : public WSAPIClientRequest {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue