game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
menubar_manager.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// ==============================================================================
3// ui/qt/menubar_manager.cpp
4// ==============================================================================
5// Extracted from MainWindow::setupMenuBar() on 2026-04-19. Fourth in the
6// MED-* manager family (DetailsPanelManager, ToolbarManager, SidebarManager,
7// MenuBarManager). Behaviour preserved verbatim.
8// ==============================================================================
9
11
16#include "mainwindow.h" // for ViewMode / SortOption enums
20#include "models/game.h"
22#include "theme_manager.h"
23
24#include <QAction>
25#include <QKeySequence>
26#include <QMainWindow>
27#include <QMenu>
28#include <QMenuBar>
29#include <QMessageBox>
30#include <QSettings>
31#include <QString>
32
33// ==============================================================================
34// Impl
35// ==============================================================================
36
38{
39 public:
40 Impl(MenuBarManager* owner, QMainWindow* window, core::GameLibraryController* libCtrl,
41 core::LaunchController* launchCtrl, core::SettingsController* settingsCtrl,
42 DetailsPanelManager* detailsPanelMgr, GameThumbnailCache* imgCache,
43 GameActionFactory* actFactory, ThemeManager* themeMgr)
44 : q(owner), mainWindow(window), libraryController(libCtrl), launchController(launchCtrl),
45 settingsController(settingsCtrl), detailsPanelManager(detailsPanelMgr),
46 imageCache(imgCache), actionFactory(actFactory), themeManager(themeMgr)
47 {
48 }
49
50 MenuBarManager* q = nullptr;
51
52 // Injected deps
53 QMainWindow* mainWindow = nullptr;
61
62 // Menu bar + five menus
63 QMenu* fileMenu = nullptr;
64 QMenu* gameMenu = nullptr;
65 QMenu* viewMenu = nullptr;
66 QMenu* toolsMenu = nullptr;
67 QMenu* helpMenu = nullptr;
68
69 // State pushed in by MainWindow
70 std::string selectedGameId;
71 ViewMode currentViewMode = ViewMode::List; // default; corrected via setter
74
75 bool isPanelVisible(const QString& name) const
76 {
77 return panelVisibilityQuery ? panelVisibilityQuery(name) : false;
78 }
79};
80
81// ==============================================================================
82// Ctor / dtor
83// ==============================================================================
84
85MenuBarManager::MenuBarManager(QMainWindow* mainWindow,
86 core::GameLibraryController* libraryController,
87 core::LaunchController* launchController,
88 core::SettingsController* settingsController,
89 DetailsPanelManager* detailsPanelManager,
90 GameThumbnailCache* imageCache, GameActionFactory* actionFactory,
91 ThemeManager* themeManager, QObject* qparent)
92 : QObject(qparent),
93 impl_(std::make_unique<Impl>(this, mainWindow, libraryController, launchController,
94 settingsController, detailsPanelManager, imageCache,
95 actionFactory, themeManager))
96{
97 // Relay factory signals as our own so MainWindow's existing connect
98 // blocks continue to work. When a per-game mutation happens inside the
99 // factory (Configure/QuickSettings/Favorite/Collections/Artwork/Remove),
100 // MainWindow wakes up through these forwards.
101 if (impl_->actionFactory)
102 {
103 connect(impl_->actionFactory, &GameActionFactory::launchRequested, this,
104 &MenuBarManager::launchRequested);
105 connect(impl_->actionFactory, &GameActionFactory::stopRequested, this,
106 &MenuBarManager::stopRequested);
107 connect(impl_->actionFactory, &GameActionFactory::gameConfigUpdated, this,
108 &MenuBarManager::gameConfigUpdated);
109 connect(impl_->actionFactory, &GameActionFactory::favoriteChanged, this,
110 &MenuBarManager::favoriteChanged);
111 connect(impl_->actionFactory, &GameActionFactory::gameListChanged, this,
112 &MenuBarManager::gameListChanged);
113 connect(impl_->actionFactory, &GameActionFactory::artworkChanged, this,
114 &MenuBarManager::artworkChanged);
115 connect(impl_->actionFactory, &GameActionFactory::removeGameRequested, this,
116 &MenuBarManager::removeGameRequested);
117 }
118}
119
121
122// ==============================================================================
123// setupMenus — the port of MainWindow::setupMenuBar()
124// ==============================================================================
125
127{
128 auto& I = *impl_;
129 const ThemeColors& c = impl_->themeManager->colors();
130
131 QMenuBar* bar = I.mainWindow->menuBar();
132 bar->setNativeMenuBar(false);
133 bar->setStyleSheet(
134 QString("QMenuBar { background-color: %1; color: %2; border-bottom: 1px solid %3; "
135 "padding: 2px 0; spacing: 2px; }"
136 "QMenuBar::item { padding: 5px 12px; border-radius: 4px; }"
137 "QMenuBar::item:selected { background-color: %4; }"
138 "QMenuBar::item:pressed { background-color: %5; color: %6; }")
139 .arg(c.cardBackground.name())
140 .arg(c.textPrimary.name())
141 .arg(c.borderLight.name())
142 .arg(c.hoverBackground.name())
143 .arg(c.accent.name())
144 .arg(c.textOnAccent.name()));
145
146 // ------------------------------------------------------------------------
147 // File menu (static)
148 // ------------------------------------------------------------------------
149 I.fileMenu = bar->addMenu(tr("&File"));
150 impl_->themeManager->styleMenu(I.fileMenu);
151
152 auto* addGameAction = I.fileMenu->addAction(tr("&Add Game..."));
153 addGameAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+N")));
154 connect(addGameAction, &QAction::triggered, this, [this]() { emit addGameRequested(); });
155
156 auto* importGamesAction = I.fileMenu->addAction(tr("&Import Games..."));
157 importGamesAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+I")));
158 connect(importGamesAction, &QAction::triggered, this,
159 [this]() { emit importGamesRequested(); });
160
161 I.fileMenu->addSeparator();
162
163 auto* exportImportAction = I.fileMenu->addAction(tr("E&xport/Import Library..."));
164 connect(exportImportAction, &QAction::triggered, this,
165 [this]() { emit exportImportRequested(); });
166
167 I.fileMenu->addSeparator();
168
169 auto* settingsAction = I.fileMenu->addAction(tr("&Settings..."));
170 settingsAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+,")));
171 connect(settingsAction, &QAction::triggered, this, [this]() { emit settingsRequested(); });
172
173 I.fileMenu->addSeparator();
174
175 auto* exitAction = I.fileMenu->addAction(tr("E&xit"));
176 exitAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+Q")));
177 connect(exitAction, &QAction::triggered, this, [this]() { emit exitRequested(); });
178
179 // ------------------------------------------------------------------------
180 // Game menu (dynamic on aboutToShow)
181 // ------------------------------------------------------------------------
182 I.gameMenu = bar->addMenu(tr("&Game"));
183 impl_->themeManager->styleMenu(I.gameMenu);
184 connect(I.gameMenu, &QMenu::aboutToShow, this,
185 [this]()
186 {
187 auto& II = *impl_;
188 II.gameMenu->clear();
189 impl_->themeManager->styleMenu(II.gameMenu);
190
191 if (II.selectedGameId.empty())
192 {
193 auto* noGame = II.gameMenu->addAction(tr("No game selected"));
194 noGame->setEnabled(false);
195 return;
196 }
197
198 const Game* game = II.libraryController->getGame(II.selectedGameId);
199 if (!game)
200 return;
201
202 const std::string gameId = II.selectedGameId;
203 GameActionFactory* factory = II.actionFactory;
204
205 // Delegate per-game action construction to the shared factory
206 // (single source of truth for Launch/Stop/Configure/Quick-Settings/
207 // Favorites/Collections/Artwork/ProtonDB/Folder/Steam/Remove).
208 // The factory connects each action directly and emits signals we
209 // relay in the constructor. Both this menu and the game-list
210 // context menu share the same factory instance.
211 if (factory)
212 {
213 factory->addLaunchActions(II.gameMenu, gameId, game);
214 II.gameMenu->addSeparator();
215 factory->addConfigureAction(II.gameMenu, gameId);
216 factory->addQuickSettingsSubmenu(II.gameMenu, gameId, game,
217 /*includeMoreSettings=*/false);
218 II.gameMenu->addSeparator();
219 factory->addFavoriteAction(II.gameMenu, gameId, game);
220 factory->addCollectionsSubmenu(II.gameMenu, gameId, game);
221 II.gameMenu->addSeparator();
222 factory->addChangeArtworkAction(II.gameMenu, gameId, game);
223 factory->addProtonDBAction(II.gameMenu, game);
224 factory->addOpenFolderAction(II.gameMenu, game);
225 factory->addSteamActions(II.gameMenu, game);
226 II.gameMenu->addSeparator();
227 factory->addRemoveAction(II.gameMenu, gameId);
228 }
229 });
230
231 // ------------------------------------------------------------------------
232 // View menu (dynamic on aboutToShow)
233 // ------------------------------------------------------------------------
234 I.viewMenu = bar->addMenu(tr("&View"));
235 impl_->themeManager->styleMenu(I.viewMenu);
236 connect(
237 I.viewMenu, &QMenu::aboutToShow, this,
238 [this]()
239 {
240 auto& II = *impl_;
241 II.viewMenu->clear();
242 impl_->themeManager->styleMenu(II.viewMenu);
243
244 // View modes
245 auto* listAction = II.viewMenu->addAction(tr("&List View"));
246 listAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+1")));
247 listAction->setCheckable(true);
248 listAction->setChecked(II.currentViewMode == ViewMode::List);
249 connect(listAction, &QAction::triggered, this,
250 [this]() { emit viewModeSelected(ViewMode::List); });
251
252 auto* gridAction = II.viewMenu->addAction(tr("&Grid View"));
253 gridAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+2")));
254 gridAction->setCheckable(true);
255 gridAction->setChecked(II.currentViewMode == ViewMode::Grid);
256 connect(gridAction, &QAction::triggered, this,
257 [this]() { emit viewModeSelected(ViewMode::Grid); });
258
259 auto* compactAction = II.viewMenu->addAction(tr("&Compact View"));
260 compactAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+3")));
261 compactAction->setCheckable(true);
262 compactAction->setChecked(II.currentViewMode == ViewMode::Compact);
263 connect(compactAction, &QAction::triggered, this,
264 [this]() { emit viewModeSelected(ViewMode::Compact); });
265
266 II.viewMenu->addSeparator();
267
268 // Sort By submenu.
269 auto* sortMenu = II.viewMenu->addMenu(tr("&Sort By"));
270 impl_->themeManager->styleMenu(sortMenu);
271 auto addSort = [&](const QString& name, SortOption opt)
272 {
273 auto* a = sortMenu->addAction(name);
274 a->setCheckable(true);
275 a->setChecked(II.currentSort == opt);
276 connect(a, &QAction::triggered, this, [this, opt]() { emit sortSelected(opt); });
277 };
278 addSort(tr("Name (A-Z)"), SortOption::NameAsc);
279 addSort(tr("Name (Z-A)"), SortOption::NameDesc);
280 addSort(tr("Recently Played"), SortOption::LastPlayedDesc);
281 addSort(tr("Most Played"), SortOption::PlayTimeDesc);
282 addSort(tr("Recently Added"), SortOption::RecentlyAddedDesc);
283
284 II.viewMenu->addSeparator();
285
286 // Panel toggles — emit signal, MainWindow routes via its existing
287 // togglePanel() dispatch (shared with the ToolbarManager path).
288 auto addPanelToggle =
289 [&](const QString& label, const QString& shortcut, const QString& panelName)
290 {
291 auto* action = II.viewMenu->addAction(label);
292 if (!shortcut.isEmpty())
293 action->setShortcut(QKeySequence(shortcut));
294 action->setCheckable(true);
295 action->setChecked(II.isPanelVisible(panelName));
296 connect(action, &QAction::triggered, this,
297 [this, panelName]() { emit panelToggleRequested(panelName); });
298 };
299 addPanelToggle(tr("&Sidebar"), QStringLiteral("Ctrl+H"), QStringLiteral("sidebar"));
300 addPanelToggle(tr("&Details Panel"), QStringLiteral("Ctrl+D"),
301 QStringLiteral("details"));
302#ifdef HAVE_QTERMWIDGET
303 addPanelToggle(tr("System &Monitor"), QString(), QStringLiteral("monitor"));
304#endif
305#ifdef HAVE_WEBENGINE
306 if (II.settingsController &&
307 II.settingsController->getAppSettings().enableHomeAssistant)
308 {
309 addPanelToggle(tr("&Home Assistant"), QStringLiteral("Ctrl+Shift+H"),
310 QStringLiteral("ha"));
311 }
312#endif
313
314 II.viewMenu->addSeparator();
315
316 // Menu mode toggle (hamburger vs menu bar).
317 auto* hamburgerAction = II.viewMenu->addAction(tr("Use &Hamburger Menu"));
318 hamburgerAction->setCheckable(true);
319 QSettings viewSettings;
320 hamburgerAction->setChecked(viewSettings.value("ui/useHamburgerMenu", false).toBool());
321 connect(hamburgerAction, &QAction::triggered, this,
322 [this](bool checked)
323 {
324 QSettings s;
325 s.setValue("ui/useHamburgerMenu", checked);
326 emit menuModeToggled(checked);
327 });
328
329 II.viewMenu->addSeparator();
330
331 // Zoom.
332 auto* zoomInAction = II.viewMenu->addAction(tr("Zoom &In"));
333 zoomInAction->setShortcut(QKeySequence(QStringLiteral("Ctrl++")));
334 connect(zoomInAction, &QAction::triggered, this, [this]() { emit zoomInRequested(); });
335
336 auto* zoomOutAction = II.viewMenu->addAction(tr("Zoom &Out"));
337 zoomOutAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+-")));
338 connect(zoomOutAction, &QAction::triggered, this,
339 [this]() { emit zoomOutRequested(); });
340
341 auto* zoomResetAction = II.viewMenu->addAction(tr("&Reset Zoom"));
342 zoomResetAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+0")));
343 connect(zoomResetAction, &QAction::triggered, this,
344 [this]() { emit zoomResetRequested(); });
345
346 II.viewMenu->addSeparator();
347
348 // Theme submenu.
349 auto* themeMenu = II.viewMenu->addMenu(tr("&Theme"));
350 impl_->themeManager->styleMenu(themeMenu);
351 QString currentThemeId = impl_->themeManager->currentThemeId();
352 for (const auto& themeId : impl_->themeManager->getAvailableThemeIds())
353 {
354 const Theme* theme = impl_->themeManager->getTheme(themeId);
355 if (!theme)
356 continue;
357 auto* action = themeMenu->addAction(theme->displayName);
358 action->setCheckable(true);
359 action->setChecked(themeId == currentThemeId);
360 connect(action, &QAction::triggered, this,
361 [this, themeId]() { emit themeSelected(themeId); });
362 }
363
364 II.viewMenu->addSeparator();
365
366 auto* refreshAction = II.viewMenu->addAction(tr("Re&fresh Library"));
367 refreshAction->setShortcut(QKeySequence(QStringLiteral("F5")));
368 connect(refreshAction, &QAction::triggered, this,
369 [this]() { emit refreshLibraryRequested(); });
370 });
371
372 // ------------------------------------------------------------------------
373 // Tools menu (static)
374 // ------------------------------------------------------------------------
375 I.toolsMenu = bar->addMenu(tr("&Tools"));
376 impl_->themeManager->styleMenu(I.toolsMenu);
377
378 auto* installLutrisAction = I.toolsMenu->addAction(tr("Install from &Lutris..."));
379 installLutrisAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+L")));
380 connect(installLutrisAction, &QAction::triggered, this,
381 [this]() { emit installFromLutrisRequested(); });
382
383 auto* manageRunnersAction = I.toolsMenu->addAction(tr("Manage &Runners..."));
384 connect(manageRunnersAction, &QAction::triggered, this,
385 [this]() { emit manageRunnersRequested(); });
386
387 I.toolsMenu->addSeparator();
388
389 auto* libraryStatsAction = I.toolsMenu->addAction(tr("Library &Statistics..."));
390 connect(libraryStatsAction, &QAction::triggered, this,
391 [this]() { emit libraryStatisticsRequested(); });
392
393 auto* downloadQueueAction = I.toolsMenu->addAction(tr("&Download Queue..."));
394 connect(downloadQueueAction, &QAction::triggered, this,
395 [this]() { emit downloadQueueRequested(); });
396
397 I.toolsMenu->addSeparator();
398
399 // System Info — self-contained dialog (no MainWindow state needed; the
400 // SystemInfoService singleton is the data source).
401 auto* systemInfoAction = I.toolsMenu->addAction(tr("S&ystem Info..."));
402 connect(
403 systemInfoAction, &QAction::triggered, this,
404 [this]()
405 {
406 auto& II = *impl_;
407 const auto& sys = SystemInfoService::instance().getCapabilities();
408 QString syncMethod =
409 sys.canUseNTSync()
410 ? tr("NTSync")
411 : (sys.canUseFsync() ? tr("Fsync")
412 : (sys.kernel.supportsEsync ? tr("Esync") : tr("None")));
413 QString info = QString("<h3>System Information</h3>"
414 "<table>"
415 "<tr><td><b>GPU:</b></td><td>%1</td></tr>"
416 "<tr><td><b>Vulkan:</b></td><td>%2</td></tr>"
417 "<tr><td><b>CPU:</b></td><td>%3 (%4 cores)</td></tr>"
418 "<tr><td><b>Sync Method:</b></td><td>%5</td></tr>"
419 "<tr><td><b>GameMode:</b></td><td>%6</td></tr>"
420 "<tr><td><b>MangoHud:</b></td><td>%7</td></tr>"
421 "<tr><td><b>Gamescope:</b></td><td>%8</td></tr>"
422 "</table>")
423 .arg(QString::fromStdString(sys.gpu.model))
424 .arg(sys.gpu.hasVulkanSupport() ? tr("Available") : tr("Not found"))
425 .arg(QString::fromStdString(sys.cpu.model))
426 .arg(sys.cpu.coreCount)
427 .arg(syncMethod)
428 .arg(sys.tools.gameMode ? tr("Available") : tr("Not installed"))
429 .arg(sys.tools.mangoHud ? tr("Available") : tr("Not installed"))
430 .arg(sys.tools.gamescope ? tr("Available") : tr("Not installed"));
431 QMessageBox msgBox(II.mainWindow);
432 msgBox.setWindowTitle(tr("System Information"));
433 msgBox.setTextFormat(Qt::RichText);
434 msgBox.setText(info);
435 msgBox.setIcon(QMessageBox::Information);
436 msgBox.exec();
437 });
438
439 // ------------------------------------------------------------------------
440 // Help menu (static)
441 // ------------------------------------------------------------------------
442 I.helpMenu = bar->addMenu(tr("&Help"));
443 impl_->themeManager->styleMenu(I.helpMenu);
444
445 auto* shortcutsAction = I.helpMenu->addAction(tr("&Keyboard Shortcuts"));
446 shortcutsAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+/")));
447 connect(shortcutsAction, &QAction::triggered, this,
448 [this]()
449 {
450 auto* sheet = new ShortcutCheatSheet(impl_->mainWindow);
451 sheet->show();
452 });
453
454 auto* commandPaletteAction = I.helpMenu->addAction(tr("&Command Palette..."));
455 commandPaletteAction->setShortcut(QKeySequence(QStringLiteral("Ctrl+Shift+P")));
456 connect(commandPaletteAction, &QAction::triggered, this,
457 [this]() { emit commandPaletteRequested(); });
458
459 I.helpMenu->addSeparator();
460
461 auto* aboutAction = I.helpMenu->addAction(tr("&About Game Launcher"));
462 connect(aboutAction, &QAction::triggered, this,
463 [this]()
464 {
465 auto& II = *impl_;
466 QMessageBox::about(II.mainWindow, tr("About Game Launcher"),
467 tr("Game Launcher v1.0.0\n\n"
468 "A Linux game launcher with Steam integration,\n"
469 "Proton/Wine support, and CachyOS optimizations.\n\n"
470 "Built with Qt6 and the core library."));
471 });
472}
473
474// ==============================================================================
475// applyTheme
476// ==============================================================================
477
479{
480 auto& I = *impl_;
481 const ThemeColors& c = impl_->themeManager->colors();
482
483 QMenuBar* bar = I.mainWindow->menuBar();
484 bar->setStyleSheet(
485 QString("QMenuBar { background-color: %1; color: %2; border-bottom: 1px solid %3; "
486 "padding: 2px 0; spacing: 2px; }"
487 "QMenuBar::item { padding: 5px 12px; border-radius: 4px; }"
488 "QMenuBar::item:selected { background-color: %4; }"
489 "QMenuBar::item:pressed { background-color: %5; color: %6; }")
490 .arg(c.cardBackground.name())
491 .arg(c.textPrimary.name())
492 .arg(c.borderLight.name())
493 .arg(c.hoverBackground.name())
494 .arg(c.accent.name())
495 .arg(c.textOnAccent.name()));
496
497 if (I.fileMenu)
498 impl_->themeManager->styleMenu(I.fileMenu);
499 if (I.gameMenu)
500 impl_->themeManager->styleMenu(I.gameMenu);
501 if (I.viewMenu)
502 impl_->themeManager->styleMenu(I.viewMenu);
503 if (I.toolsMenu)
504 impl_->themeManager->styleMenu(I.toolsMenu);
505 if (I.helpMenu)
506 impl_->themeManager->styleMenu(I.helpMenu);
507}
508
509// ==============================================================================
510// Setters
511// ==============================================================================
512
513void MenuBarManager::setSelectedGameId(const std::string& gameId)
514{
515 impl_->selectedGameId = gameId;
516}
517
519{
520 impl_->currentViewMode = mode;
521}
522
524{
525 impl_->currentSort = sort;
526}
527
529{
530 impl_->panelVisibilityQuery = std::move(query);
531}
void addQuickSettingsSubmenu(QMenu *menu, const std::string &gameId, const Game *game, bool includeMoreSettings)
"Quick Settings" submenu with MangoHud / GameMode / Gamescope / VkBasalt toggles.
void addCollectionsSubmenu(QMenu *menu, const std::string &gameId, const Game *game)
"Collections" submenu listing every collection as a checkmarked action, plus "Create New....
void addChangeArtworkAction(QMenu *menu, const std::string &gameId, const Game *game)
"Change Artwork..." — opens SteamGridDBSelectorDialog if the game has a Steam App ID.
void addFavoriteAction(QMenu *menu, const std::string &gameId, const Game *game)
Favorite toggle (text flips between Add/Remove based on current state).
void addConfigureAction(QMenu *menu, const std::string &gameId)
Configure... — opens GameConfigDialog.
void addRemoveAction(QMenu *menu, const std::string &gameId)
"Remove from Library" with confirmation QMessageBox.
void addProtonDBAction(QMenu *menu, const Game *game)
"View on ProtonDB" — opens https://www.protondb.com/app/{appId} in the default browser.
void addOpenFolderAction(QMenu *menu, const Game *game)
"Open Game Folder" — opens the executable's parent directory in the file manager.
void addSteamActions(QMenu *menu, const Game *game)
Steam actions — "Manage in Steam..." (if installed) and "View on Steam Store" (always for Steam games...
void addLaunchActions(QMenu *menu, const std::string &gameId, const Game *game)
Launch (if installed + not running), Stop (if running), or Install via Steam (if Steam game + not ins...
Complete representation of a game in the library.
Definition game.h:767
core::SettingsController * settingsController
ThemeManager * themeManager
GameThumbnailCache * imageCache
core::GameLibraryController * libraryController
core::LaunchController * launchController
bool isPanelVisible(const QString &name) const
PanelVisibilityQuery panelVisibilityQuery
DetailsPanelManager * detailsPanelManager
Impl(MenuBarManager *owner, QMainWindow *window, core::GameLibraryController *libCtrl, core::LaunchController *launchCtrl, core::SettingsController *settingsCtrl, DetailsPanelManager *detailsPanelMgr, GameThumbnailCache *imgCache, GameActionFactory *actFactory, ThemeManager *themeMgr)
GameActionFactory * actionFactory
void addGameRequested()
std::function< bool(const QString &)> PanelVisibilityQuery
Panel-visibility getter.
void setSortOption(SortOption sort)
void setViewMode(ViewMode mode)
Current view-mode / sort-option — needed so the View menu's checkbox indicators and Sort By radio gro...
~MenuBarManager() override
void setPanelVisibilityQuery(PanelVisibilityQuery query)
void importGamesRequested()
void setupMenus()
Build the menu bar and all five top-level menus. Call once.
void setSelectedGameId(const std::string &gameId)
Propagate the current selection.
void exportImportRequested()
void exitRequested()
void applyTheme()
Re-apply theme styling to every menu.
MenuBarManager(QMainWindow *mainWindow, core::GameLibraryController *libraryController, core::LaunchController *launchController, core::SettingsController *settingsController, DetailsPanelManager *detailsPanelManager, GameThumbnailCache *imageCache, GameActionFactory *actionFactory, ThemeManager *themeManager, QObject *qparent=nullptr)
void settingsRequested()
static SystemInfoService & instance()
Get singleton instance.
const SystemCapabilities & getCapabilities()
Get complete system capabilities.
ViewMode
Definition mainwindow.h:75
SortOption
Definition mainwindow.h:86
@ RecentlyAddedDesc
Definition mainwindow.h:93
QColor borderLight
QColor cardBackground
QColor textPrimary
QColor hoverBackground
QColor textOnAccent
QString displayName