mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-19 09:15:33 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/189fa68c0b3
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…
Reference in a new issue