113 explicit MainWindow(QWidget* parent =
nullptr);
122 bool eventFilter(QObject* obj, QEvent* event)
override;
124 void dropEvent(QDropEvent* event)
override;
128 void onGameSelected(
const QModelIndex& current,
const QModelIndex& previous);
129 void onLaunchClicked();
130 void onStopClicked();
131 void onSearchTextChanged(
const QString& text);
132 void onAddGameClicked();
133 void onSettingsClicked();
134 void onRefreshLibrary();
135 void onTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
138 void onViewModeChanged(
ViewMode mode);
139 void onSortChanged(
int index);
140 void onZoomChanged(
int value);
143 void onSteamDownloadProgress(uint32_t appId,
double progress,
const QString& status);
144 void onSteamInstallComplete(uint32_t appId);
145 void onSteamUninstallComplete(uint32_t appId, uint32_t previousState);
148 void onAsyncImageLoaded(
const QString& cacheKey,
const QPixmap& pixmap);
155 void setupGameList();
156 void setupGameListContextMenu();
157 void setupStatusBar();
158 void setupTrayIcon();
159 void setupControllerCallbacks();
160 void setupSteamDownloadMonitor();
161 void setupCommandPalette();
162 void registerPaletteCommands();
164 void refreshGameList();
165 void applyViewMode();
166 void updateGridIconSize();
167 void setupKeyboardShortcuts();
169 void deleteSelectedGame();
170 void toggleSelectedFavorite();
172 int rowForGameId(
const std::string& gameId)
const;
174 QModelIndex proxyIndexForGameId(
const std::string& gameId)
const;
176 void updateGameRow(
const std::string& gameId);
177 void populateRunnerVersions();
178 void updateCollectionsList();
179 void showCreateCollectionDialog();
180 void updateSourceFilters();
181 void updateCategoryCounts();
182 void syncSteamInstalledStatus();
183 void fetchMissingProtonDB();
188 void updateMenuMode();
191 void togglePanel(QWidget* panel, QPushButton* btn,
const QString& name);
192 void popOutPanel(QWidget* panel, QWidget*& poppedWindow,
const QString& title,
int width,
194 void updateToolbarVisibility();
195 void updateRunningGameStatus();
196 QWidget* createPanelContainer(QWidget* content,
const QString& title, QWidget*& poppedWindow,
197 int popWidth,
int popHeight);
198 void movePanelLeft(QWidget* container);
199 void movePanelRight(QWidget* container);
202 std::unique_ptr<core::GameLibraryController> libraryController_;
203 std::unique_ptr<core::LaunchController> launchController_;
204 std::unique_ptr<core::SettingsController> settingsController_;
207 std::unique_ptr<PerformanceProfileService> performanceProfileService_;
210 std::unique_ptr<SteamDownloadMonitor> steamDownloadMonitor_;
213 std::shared_ptr<QtNotificationService> notificationService_;
219 QSplitter* mainSplitter_;
222 QWidget* sidebarContainer_ =
nullptr;
223 QWidget* gameListContainer_ =
nullptr;
224 QWidget* detailsContainer_ =
nullptr;
225#ifdef HAVE_QTERMWIDGET
226 QWidget* terminalContainer_ =
nullptr;
229 QWidget* haContainer_ =
nullptr;
239 QWidget* sidebar_ =
nullptr;
240 QListView* gameList_;
243 QWidget* gameListEmptyOverlay_ =
nullptr;
244 QLabel* emptyStateLabel_ =
nullptr;
245 QPushButton* emptyStateAddButton_ =
nullptr;
246 QPushButton* emptyStateImportButton_ =
nullptr;
247 QPushButton* emptyStateClearSearchButton_ =
nullptr;
248 QPushButton* emptyStateShowAllButton_ =
nullptr;
254 std::unique_ptr<DetailsPanelManager> detailsPanelManager_;
255 QWidget* detailsPanel_ =
nullptr;
262 QLineEdit* searchEdit_ =
nullptr;
263 QComboBox* sortCombo_ =
nullptr;
264 QSlider* zoomSlider_ =
nullptr;
265 QLabel* zoomLabel_ =
nullptr;
266 int zoomLevel_ = 100;
267 QLabel* statusLabel_;
268 QSystemTrayIcon* trayIcon_;
273 void invalidateGameItemCache();
278 std::unique_ptr<GameThumbnailCache> imageCache_;
281 std::atomic<bool> isShuttingDown_{
false};
284 QTimer* refreshDebounceTimer_ =
nullptr;
285 void scheduleRefresh();
288 void applyZoomChange();
291 QTimer* resizeDebounceTimer_ =
nullptr;
294 QTimer* frameMetricsTimer_ =
nullptr;
299 QProgressBar* statusProgressBar_ =
nullptr;
304 QAction* listViewAction_ =
nullptr;
305 QAction* gridViewAction_ =
nullptr;
306 QAction* compactViewAction_ =
nullptr;
307 QActionGroup* viewModeGroup_ =
nullptr;
313 QMenu* trayMenu_ =
nullptr;
315#ifdef HAVE_QTERMWIDGET
318 QAction* toggleTerminalAction_ =
nullptr;
321 QComboBox* monitorTypeCombo_ =
nullptr;
322 QPushButton* monitorRestartBtn_ =
nullptr;
329 QPushButton* panelHABtn_ =
nullptr;
330 bool savedHAVisible_ =
false;
334 QPushButton* panelSidebarBtn_ =
nullptr;
335 QPushButton* panelGamesBtn_ =
nullptr;
336 QPushButton* panelDetailsBtn_ =
nullptr;
337#ifdef HAVE_QTERMWIDGET
338 QPushButton* panelMonitorBtn_ =
nullptr;
348 std::unique_ptr<ToolbarManager> toolbarManager_;
351 std::unique_ptr<SidebarManager> sidebarManager_;
354 std::unique_ptr<MenuBarManager> menuBarManager_;
360 std::unique_ptr<GameActionFactory> gameActionFactory_;
365 std::unique_ptr<ContextMenuManager> contextMenuManager_;
370 std::unique_ptr<ShortcutsController> shortcutsController_;
373 QWidget* poppedSidebar_ =
nullptr;
374 QWidget* poppedGameList_ =
nullptr;
375 QWidget* poppedDetails_ =
nullptr;
376#ifdef HAVE_QTERMWIDGET
377 QWidget* poppedMonitor_ =
nullptr;
380 QWidget* poppedHA_ =
nullptr;
387 std::string selectedGameId_;
388 std::string currentFilter_;
389 std::string currentCollection_;
390 int currentCategory_ = 0;
393 bool forceQuit_ =
false;
396 std::string previousRunningGameId_;
397 QRect savedNormalGeometry_;
398 bool isInGamingLayout_ =
false;
399 bool gamingLayoutOverridden_ =
403 QList<int> savedSplitterSizes_;
404 bool savedSidebarVisible_ =
true;
405 bool savedGameListVisible_ =
true;
406 bool savedDetailsVisible_ =
true;
407 bool savedMonitorVisible_ =
false;
410 void onGameStarted(
const std::string& gameId);
411 void onGameStopped(
const std::string& gameId);
412 void enterGamingLayout();
413 void exitGamingLayout();
414 void checkRunningGameOnStartup();
417 static constexpr int GRID_ICON_WIDTH = 150;
418 static constexpr int GRID_ICON_HEIGHT = 225;
419 static constexpr int COMPACT_ICON_SIZE = 48;
void setNotificationService(std::shared_ptr< QtNotificationService > service)
bool eventFilter(QObject *obj, QEvent *event) override