summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r--Libraries/LibGUI/Menu.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Libraries/LibGUI/Menu.h b/Libraries/LibGUI/Menu.h
index aa9956c886..d8ebb1dd93 100644
--- a/Libraries/LibGUI/Menu.h
+++ b/Libraries/LibGUI/Menu.h
@@ -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();