+ }
+}
+
+void MainWindow::fill_menu_from_theme_menu(const vector<unique_ptr<Theme::MenuEntry>> &entries, QMenu *menu)
+{
+ for (const unique_ptr<Theme::MenuEntry> &entry : entries) {
+ if (entry->is_submenu) {
+ QMenu *submenu = new QMenu(QString::fromStdString(entry->text));
+ fill_menu_from_theme_menu(entry->submenu, submenu);
+ menu->addMenu(submenu);
+ continue;
+ }
+
+ 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);
+ });