]> git.sesse.net Git - nageru/blobdiff - nageru/mainwindow.cpp
Make it possible to put checkboxes on theme menu entries.
[nageru] / nageru / mainwindow.cpp
index f33c57d6b2d24f6343c9bab2b04464e6ed489e8f..73362229ce35e8efc70f9cf5dcfe4c25a6e73037 100644 (file)
@@ -910,6 +910,12 @@ void MainWindow::fill_menu_from_theme_menu(const vector<unique_ptr<Theme::MenuEn
                }
 
                QAction *action = menu->addAction(QString::fromStdString(entry->text));
+               if (entry->entry.flags == Theme::MenuEntry::CHECKABLE) {
+                       action->setCheckable(true);
+               } else if (entry->entry.flags == Theme::MenuEntry::CHECKED) {
+                       action->setCheckable(true);
+                       action->setChecked(true);
+               }
                connect(action, &QAction::triggered, [lua_ref = entry->entry.lua_ref] {
                        global_mixer->theme_menu_entry_clicked(lua_ref);
                });