mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:27:35 +00:00
LibGUI: Expose GUI::Menu::menu_id() and also allow forced realization
Menu realization is when we instruct WindowServer to create the server-side menu objects on our behalf.
This commit is contained in:
parent
7afd9039d1
commit
189fa68c0b
1 changed files with 7 additions and 1 deletions
|
@ -39,7 +39,14 @@ public:
|
|||
explicit Menu(const StringView& name = "");
|
||||
virtual ~Menu() override;
|
||||
|
||||
void realize_menu_if_needed()
|
||||
{
|
||||
if (menu_id() == -1)
|
||||
realize_menu();
|
||||
}
|
||||
|
||||
static Menu* from_menu_id(int);
|
||||
int menu_id() const { return m_menu_id; }
|
||||
|
||||
const String& name() const { return m_name; }
|
||||
|
||||
|
@ -55,7 +62,6 @@ public:
|
|||
private:
|
||||
friend class MenuBar;
|
||||
|
||||
int menu_id() const { return m_menu_id; }
|
||||
int realize_menu();
|
||||
void unrealize_menu();
|
||||
void realize_if_needed();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue