]> git.sesse.net Git - nageru/blobdiff - nageru/theme.h
Make it possible to put checkboxes on theme menu entries.
[nageru] / nageru / theme.h
index 22a9ff7d3423a4e203c9fc688be2f4f354306ca5..b4e8d8c406bcd612637eb662882d04798a115f2d 100644 (file)
@@ -149,12 +149,15 @@ public:
 #endif
 
        struct MenuEntry {
-               MenuEntry(const std::string &text, lua_State *L, int lua_ref)
-                       : text(text), is_submenu(false), entry{L, lua_ref} {}
+               MenuEntry(const std::string &text, lua_State *L, int lua_ref, unsigned flags)
+                       : text(text), is_submenu(false), entry{L, lua_ref, flags} {}
                MenuEntry(const std::string &text, std::vector<std::unique_ptr<MenuEntry>> submenu)
                        : text(text), is_submenu(true), submenu(std::move(submenu)) {}
                ~MenuEntry();
 
+               static constexpr unsigned CHECKABLE = 1;
+               static constexpr unsigned CHECKED = 2;
+
                std::string text;
                bool is_submenu;
 
@@ -163,6 +166,7 @@ public:
                        struct {
                                lua_State *L;
                                int lua_ref;
+                               unsigned flags;
                        } entry;
 
                        // is_submenu = true.