diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-08-28 21:11:53 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-29 06:36:29 +0200 |
commit | 63e6b09816c5d144e83138d3fd471b800d29a52a (patch) | |
tree | 7daa439cf56e3c9e6131aa7a52fb7432ca0e32e6 /Servers/WindowServer/WSMenuItem.h | |
parent | d3ebd8897f27c75ddf0bb75d401a6ea55761b1bd (diff) | |
download | serenity-63e6b09816c5d144e83138d3fd471b800d29a52a.zip |
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!
Diffstat (limited to 'Servers/WindowServer/WSMenuItem.h')
-rw-r--r-- | Servers/WindowServer/WSMenuItem.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Servers/WindowServer/WSMenuItem.h b/Servers/WindowServer/WSMenuItem.h index 27b9595222..fe334b3c0d 100644 --- a/Servers/WindowServer/WSMenuItem.h +++ b/Servers/WindowServer/WSMenuItem.h @@ -44,6 +44,12 @@ public: const GraphicsBitmap* icon() const { return m_icon; } void set_icon(const GraphicsBitmap* icon) { m_icon = icon; } + bool is_submenu() const { return m_submenu_id != -1; } + int submenu_id() const { return m_submenu_id; } + void set_submenu_id(int submenu_id) { m_submenu_id = submenu_id; } + + WSMenu* submenu(); + private: WSMenu& m_menu; Type m_type { None }; @@ -55,4 +61,5 @@ private: String m_shortcut_text; Rect m_rect; RefPtr<GraphicsBitmap> m_icon; + int m_submenu_id { -1 }; }; |