31#include <QDesktopServices>
34#include <QInputDialog>
40#include <QProgressBar>
43#include <QSignalBlocker>
51#include <unordered_map>
60 QProcess::startDetached(
"steam", {steamUrl});
73 : QObject(owner), owner_(owner), libCtrl_(libCtrl), launchCtrl_(launchCtrl),
74 imgCache_(imgCache), themeMgr_(themeMgr)
79 void update(
const std::string& gameId);
84 bool eventFilter(QObject* obj, QEvent* event)
override;
93 return heroImageLabel_;
97 return downloadProgressWidget_;
101 return downloadProgressBar_;
105 return downloadProgressLabel_;
109 return launchButton_;
113 return frameMetricsWidget_;
120 void setupWidgets(QWidget* parent);
124 uint64_t getCachedDiskSpace(
const std::string& path);
126 struct DiskSpaceCacheEntry
129 uint64_t availableBytes = 0;
130 std::chrono::steady_clock::time_point lastUpdate;
132 std::unordered_map<std::string, DiskSpaceCacheEntry> diskSpaceCache_;
142 QWidget* detailsPanel_ =
nullptr;
143 QLabel* heroImageLabel_ =
nullptr;
144 QLabel* logoImageLabel_ =
nullptr;
145 QLabel* gameNameLabel_ =
nullptr;
146 QLabel* gameInfoLabel_ =
nullptr;
147 QLabel* coverArtLabel_ =
nullptr;
148 QLabel* gameDescLabel_ =
nullptr;
149 QLabel* gameGenresLabel_ =
nullptr;
150 QLabel* gameStatsLabel_ =
nullptr;
151 QLabel* gameSteamInfoLabel_ =
nullptr;
152 QLabel* gameLaunchConfigLabel_ =
nullptr;
154 QComboBox* completionStatusCombo_ =
nullptr;
155 QProgressBar* completionProgressBar_ =
nullptr;
157 QWidget* hltbSection_ =
nullptr;
158 QLabel* hltbMainLabel_ =
nullptr;
159 QLabel* hltbExtrasLabel_ =
nullptr;
160 QLabel* hltbCompleteLabel_ =
nullptr;
162 QWidget* sessionHistorySection_ =
nullptr;
163 QLabel* sessionHistoryLabel_ =
nullptr;
165 QWidget* userNotesSection_ =
nullptr;
166 QLabel* userNotesLabel_ =
nullptr;
168 QWidget* configPresetsSection_ =
nullptr;
169 QHBoxLayout* presetsButtonLayout_ =
nullptr;
171 QLabel* collectionsLabel_ =
nullptr;
179 QWidget* runningInfoContainer_ =
nullptr;
180 QLabel* gameRunningInfoLabel_ =
nullptr;
182 QLabel* systemInfoLabel_ =
nullptr;
184 QWidget* downloadProgressWidget_ =
nullptr;
185 QProgressBar* downloadProgressBar_ =
nullptr;
186 QLabel* downloadProgressLabel_ =
nullptr;
188 QWidget* updateBannerWidget_ =
nullptr;
189 QLabel* updateBannerLabel_ =
nullptr;
190 QPushButton* updateNowButton_ =
nullptr;
192 QPushButton* launchButton_ =
nullptr;
193 QPushButton* stopButton_ =
nullptr;
194 QPushButton* configButton_ =
nullptr;
200void DetailsPanelManager::Impl::setupWidgets(QWidget* parent)
204 detailsPanel_ =
new QWidget(parent);
205 QVBoxLayout* detailsLayout =
new QVBoxLayout(detailsPanel_);
206 detailsLayout->setContentsMargins(0, 0, 0, 16);
207 detailsLayout->setSpacing(0);
211 heroImageLabel_ =
new QLabel(detailsPanel_);
212 heroImageLabel_->setAlignment(Qt::AlignCenter);
213 heroImageLabel_->setScaledContents(
false);
214 heroImageLabel_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
215 heroImageLabel_->setStyleSheet(QString(
"background-color: %1; border-bottom: 1px solid %2;")
218 heroImageLabel_->setVisible(
false);
221 logoImageLabel_ =
new QLabel(detailsPanel_);
222 logoImageLabel_->setAlignment(Qt::AlignBottom | Qt::AlignLeft);
223 logoImageLabel_->setStyleSheet(
"background: transparent;");
224 logoImageLabel_->setVisible(
false);
226 detailsLayout->addWidget(heroImageLabel_);
231 QWidget* headerWidget =
new QWidget(detailsPanel_);
232 headerWidget->setStyleSheet(QString(
"background-color: %1; border-bottom: 1px solid %2;")
235 QVBoxLayout* headerLayout =
new QVBoxLayout(headerWidget);
236 headerLayout->setContentsMargins(16, 10, 16, 10);
237 headerLayout->setSpacing(4);
240 gameNameLabel_ =
new QLabel(headerWidget);
241 gameNameLabel_->setStyleSheet(
243 "font-size: %2px; font-weight: bold; color: %1; background: transparent; border: none;")
246 gameNameLabel_->setAlignment(Qt::AlignLeft);
247 gameNameLabel_->setWordWrap(
true);
248 headerLayout->addWidget(gameNameLabel_);
251 gameInfoLabel_ =
new QLabel(headerWidget);
252 gameInfoLabel_->setStyleSheet(
253 QString(
"color: %1; font-size: 11px; background: transparent; border: none;")
255 gameInfoLabel_->setAlignment(Qt::AlignLeft);
256 gameInfoLabel_->setWordWrap(
true);
257 headerLayout->addWidget(gameInfoLabel_);
260 gameGenresLabel_ =
new QLabel(headerWidget);
261 gameGenresLabel_->setStyleSheet(
262 QString(
"color: %1; font-size: 10px; background: transparent; border: none;")
263 .arg(c.
info.name()));
264 gameGenresLabel_->setAlignment(Qt::AlignLeft);
265 gameGenresLabel_->setWordWrap(
true);
266 gameGenresLabel_->setVisible(
false);
267 headerLayout->addWidget(gameGenresLabel_);
270 headerLayout->addSpacing(6);
271 QHBoxLayout* buttonLayout =
new QHBoxLayout();
272 buttonLayout->setSpacing(8);
274 launchButton_ =
new QPushButton(
"Launch", headerWidget);
275 launchButton_->setMinimumHeight(34);
276 launchButton_->setCursor(Qt::PointingHandCursor);
277 launchButton_->setStyleSheet(
278 QString(
"QPushButton { background-color: %1; color: %6; font-weight: bold; "
279 "border-radius: 6px; padding: 0 24px; border: none; }"
280 "QPushButton:hover { background-color: %2; }"
281 "QPushButton:pressed { background-color: %3; }"
282 "QPushButton:disabled { background-color: %4; color: %5; }")
289 connect(launchButton_, &QPushButton::clicked,
this,
291 buttonLayout->addWidget(launchButton_);
293 stopButton_ =
new QPushButton(
"Stop", headerWidget);
294 stopButton_->setMinimumHeight(34);
295 stopButton_->setCursor(Qt::PointingHandCursor);
296 stopButton_->setStyleSheet(
297 QString(
"QPushButton { background-color: %1; color: %5; font-weight: bold; "
298 "border-radius: 6px; padding: 0 24px; border: none; }"
299 "QPushButton:hover { background-color: %2; }"
300 "QPushButton:pressed { background-color: %3; }"
301 "QPushButton:disabled { background-color: %4; }")
307 stopButton_->setVisible(
false);
308 connect(stopButton_, &QPushButton::clicked,
this,
310 buttonLayout->addWidget(stopButton_);
312 configButton_ =
new QPushButton(
"Configure", headerWidget);
313 configButton_->setMinimumHeight(34);
314 configButton_->setCursor(Qt::PointingHandCursor);
315 configButton_->setStyleSheet(
316 QString(
"QPushButton { background-color: %1; color: %2; font-weight: bold; "
317 "border-radius: 6px; border: 1px solid %3; padding: 0 20px; }"
318 "QPushButton:hover { background-color: %4; border-color: %5; }"
319 "QPushButton:pressed { background-color: %6; }")
326 connect(configButton_, &QPushButton::clicked,
this,
328 buttonLayout->addWidget(configButton_);
329 buttonLayout->addStretch();
331 headerLayout->addLayout(buttonLayout);
332 detailsLayout->addWidget(headerWidget);
337 QScrollArea* detailsScrollArea =
new QScrollArea(detailsPanel_);
338 detailsScrollArea->setWidgetResizable(
true);
339 detailsScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
340 detailsScrollArea->setFrameShape(QFrame::NoFrame);
341 detailsScrollArea->setStyleSheet(
342 QString(
"QScrollArea { background-color: %1; }").arg(c.
windowBackground.name()));
344 QWidget* contentWidget =
new QWidget(detailsScrollArea);
345 QVBoxLayout* contentLayout =
new QVBoxLayout(contentWidget);
346 contentLayout->setContentsMargins(16, 12, 16, 0);
347 contentLayout->setSpacing(4);
354 new CollapsibleSection(
"Overview",
"details/overview_collapsed",
false, contentWidget);
357 coverArtLabel_ =
new QLabel(contentWidget);
358 coverArtLabel_->setMinimumSize(140, 210);
359 coverArtLabel_->setMaximumSize(200, 300);
360 coverArtLabel_->setAlignment(Qt::AlignCenter);
361 coverArtLabel_->setStyleSheet(
362 QString(
"background-color: %1; border-radius: 4px;").arg(c.
cardBackground.name()));
363 coverArtLabel_->setText(QString(
"<div style='text-align:center; color:%1;'>"
364 "<span style='font-family:%2; font-size:32px;'>%3</span><br>"
365 "<span style='font-size:10px;'>No Cover Art</span></div>")
370 QWidget* coverArtWrapper =
new QWidget(contentWidget);
371 QHBoxLayout* coverArtWrapperLayout =
new QHBoxLayout(coverArtWrapper);
372 coverArtWrapperLayout->setContentsMargins(0, 0, 0, 0);
373 coverArtWrapperLayout->addStretch();
374 coverArtWrapperLayout->addWidget(coverArtLabel_);
375 coverArtWrapperLayout->addStretch();
376 overviewSection_->addWidget(coverArtWrapper);
379 gameDescLabel_ =
new QLabel(contentWidget);
380 gameDescLabel_->setStyleSheet(
381 QString(
"color: %1; font-size: 10px; margin-top: 8px; padding: 8px; "
382 "background-color: %2; border-radius: 4px;")
385 gameDescLabel_->setAlignment(Qt::AlignLeft | Qt::AlignTop);
386 gameDescLabel_->setWordWrap(
true);
387 gameDescLabel_->setMaximumHeight(80);
388 gameDescLabel_->setVisible(
false);
389 overviewSection_->addWidget(gameDescLabel_);
391 contentLayout->addWidget(overviewSection_);
398 new CollapsibleSection(
"Statistics",
"details/statistics_collapsed",
false, contentWidget);
401 gameStatsLabel_ =
new QLabel(contentWidget);
402 gameStatsLabel_->setStyleSheet(
403 QString(
"color: %1; font-size: 11px; margin-top: 6px;").arg(c.
textSecondary.name()));
404 gameStatsLabel_->setAlignment(Qt::AlignCenter);
405 gameStatsLabel_->setWordWrap(
true);
406 statisticsSection_->addWidget(gameStatsLabel_);
409 gameSteamInfoLabel_ =
new QLabel(contentWidget);
410 gameSteamInfoLabel_->setStyleSheet(
411 QString(
"color: %1; font-size: 10px; margin-top: 2px;").arg(c.
info.name()));
412 gameSteamInfoLabel_->setAlignment(Qt::AlignCenter);
413 gameSteamInfoLabel_->setWordWrap(
true);
414 gameSteamInfoLabel_->setVisible(
false);
415 statisticsSection_->addWidget(gameSteamInfoLabel_);
418 QWidget* completionRow =
new QWidget(contentWidget);
419 QHBoxLayout* completionRowLayout =
new QHBoxLayout(completionRow);
420 completionRowLayout->setContentsMargins(0, 4, 0, 0);
421 completionRowLayout->setSpacing(6);
422 completionRowLayout->addStretch();
424 completionStatusCombo_ =
new QComboBox(contentWidget);
432 completionStatusCombo_->setMaximumWidth(120);
433 completionStatusCombo_->setStyleSheet(
434 QString(
"QComboBox { background-color: %1; color: %2; border: 1px solid %3; "
435 "border-radius: 3px; padding: 2px 8px; font-size: 10px; }"
436 "QComboBox:hover { border-color: %4; }"
437 "QComboBox::drop-down { border: none; width: 16px; }"
438 "QComboBox::down-arrow { image: none; border-left: 4px solid transparent; "
439 "border-right: 4px solid transparent; border-top: 5px solid %2; }")
442 connect(completionStatusCombo_, QOverload<int>::of(&QComboBox::currentIndexChanged),
this,
451 static_cast<CompletionStatus>(completionStatusCombo_->itemData(index).toInt());
455 completionRowLayout->addWidget(completionStatusCombo_);
456 completionRowLayout->addStretch();
457 statisticsSection_->addWidget(completionRow);
460 completionProgressBar_ =
new QProgressBar(contentWidget);
461 completionProgressBar_->setMinimum(0);
462 completionProgressBar_->setMaximum(100);
463 completionProgressBar_->setValue(0);
464 completionProgressBar_->setTextVisible(
false);
465 completionProgressBar_->setMinimumHeight(4);
466 completionProgressBar_->setMaximumHeight(4);
467 completionProgressBar_->setStyleSheet(
468 QString(
"QProgressBar { background-color: %1; border-radius: 2px; }"
469 "QProgressBar::chunk { background-color: %2; border-radius: 2px; }")
471 completionProgressBar_->setVisible(
false);
472 statisticsSection_->addWidget(completionProgressBar_);
475 hltbSection_ =
new QWidget(contentWidget);
476 hltbSection_->setStyleSheet(
477 QString(
"background-color: %1; border-radius: 4px; margin-top: 6px;")
479 QVBoxLayout* hltbLayout =
new QVBoxLayout(hltbSection_);
480 hltbLayout->setContentsMargins(10, 8, 10, 8);
481 hltbLayout->setSpacing(4);
483 QLabel* hltbTitle =
new QLabel(
"How Long To Beat", hltbSection_);
484 hltbTitle->setStyleSheet(
485 QString(
"font-weight: bold; color: %1; font-size: 10px;").arg(c.
textSecondary.name()));
486 hltbLayout->addWidget(hltbTitle);
488 QHBoxLayout* hltbTimesRow =
new QHBoxLayout();
489 hltbTimesRow->setSpacing(12);
491 hltbMainLabel_ =
new QLabel(hltbSection_);
492 hltbMainLabel_->setStyleSheet(
493 QString(
"color: %1; font-size: 10px;").arg(c.
textSecondary.name()));
494 hltbTimesRow->addWidget(hltbMainLabel_);
496 hltbExtrasLabel_ =
new QLabel(hltbSection_);
497 hltbExtrasLabel_->setStyleSheet(
498 QString(
"color: %1; font-size: 10px;").arg(c.
textSecondary.name()));
499 hltbTimesRow->addWidget(hltbExtrasLabel_);
501 hltbCompleteLabel_ =
new QLabel(hltbSection_);
502 hltbCompleteLabel_->setStyleSheet(
503 QString(
"color: %1; font-size: 10px;").arg(c.
textSecondary.name()));
504 hltbTimesRow->addWidget(hltbCompleteLabel_);
506 hltbTimesRow->addStretch();
507 hltbLayout->addLayout(hltbTimesRow);
509 hltbSection_->setVisible(
false);
510 statisticsSection_->addWidget(hltbSection_);
513 sessionHistorySection_ =
new QWidget(contentWidget);
514 sessionHistorySection_->setStyleSheet(
515 QString(
"background-color: %1; border-radius: 4px; margin-top: 6px;")
517 QVBoxLayout* sessionLayout =
new QVBoxLayout(sessionHistorySection_);
518 sessionLayout->setContentsMargins(10, 8, 10, 8);
519 sessionLayout->setSpacing(4);
521 QLabel* sessionTitle =
new QLabel(
"Recent Sessions", sessionHistorySection_);
522 sessionTitle->setStyleSheet(
523 QString(
"font-weight: bold; color: %1; font-size: 10px;").arg(c.
textSecondary.name()));
524 sessionLayout->addWidget(sessionTitle);
526 sessionHistoryLabel_ =
new QLabel(sessionHistorySection_);
527 sessionHistoryLabel_->setStyleSheet(
528 QString(
"color: %1; font-size: 10px;").arg(c.
textSecondary.name()));
529 sessionHistoryLabel_->setWordWrap(
true);
530 sessionHistoryLabel_->setTextFormat(Qt::RichText);
531 sessionLayout->addWidget(sessionHistoryLabel_);
533 sessionHistorySection_->setVisible(
false);
534 statisticsSection_->addWidget(sessionHistorySection_);
536 contentLayout->addWidget(statisticsSection_);
542 configurationSection_ =
new CollapsibleSection(
543 "Configuration",
"details/configuration_collapsed",
true, contentWidget);
546 gameLaunchConfigLabel_ =
new QLabel(contentWidget);
547 gameLaunchConfigLabel_->setStyleSheet(
548 QString(
"color: %1; font-size: 10px; margin-top: 10px; padding: 10px; "
549 "background-color: %2; border-radius: 4px; border: 1px solid %3;")
553 gameLaunchConfigLabel_->setAlignment(Qt::AlignLeft | Qt::AlignTop);
554 gameLaunchConfigLabel_->setWordWrap(
true);
555 gameLaunchConfigLabel_->setTextFormat(Qt::RichText);
556 gameLaunchConfigLabel_->setVisible(
false);
557 configurationSection_->addWidget(gameLaunchConfigLabel_);
560 configPresetsSection_ =
new QWidget(contentWidget);
561 configPresetsSection_->setStyleSheet(
562 QString(
"background-color: %1; border-radius: 4px; margin-top: 6px;")
564 QVBoxLayout* presetsLayout =
new QVBoxLayout(configPresetsSection_);
565 presetsLayout->setContentsMargins(10, 8, 10, 8);
566 presetsLayout->setSpacing(6);
568 QLabel* presetsTitle =
new QLabel(
"Config Presets", configPresetsSection_);
569 presetsTitle->setStyleSheet(
570 QString(
"font-weight: bold; color: %1; font-size: 10px;").arg(c.
textSecondary.name()));
571 presetsLayout->addWidget(presetsTitle);
573 presetsButtonLayout_ =
new QHBoxLayout();
574 presetsButtonLayout_->setSpacing(4);
575 presetsLayout->addLayout(presetsButtonLayout_);
577 configPresetsSection_->setVisible(
false);
578 configurationSection_->addWidget(configPresetsSection_);
581 collectionsLabel_ =
new QLabel(contentWidget);
582 collectionsLabel_->setStyleSheet(
583 QString(
"color: %1; font-size: 10px; margin-top: 6px;").arg(c.
info.name()));
584 collectionsLabel_->setWordWrap(
true);
585 collectionsLabel_->setTextFormat(Qt::RichText);
586 collectionsLabel_->setVisible(
false);
587 configurationSection_->addWidget(collectionsLabel_);
589 contentLayout->addWidget(configurationSection_);
595 notesSection_ =
new CollapsibleSection(
"Notes",
"details/notes_collapsed",
true, contentWidget);
598 userNotesSection_ =
new QWidget(contentWidget);
599 userNotesSection_->setStyleSheet(
600 QString(
"background-color: %1; border-radius: 4px; margin-top: 6px;")
602 QVBoxLayout* notesLayout =
new QVBoxLayout(userNotesSection_);
603 notesLayout->setContentsMargins(10, 8, 10, 8);
604 notesLayout->setSpacing(4);
606 QLabel* notesTitle =
new QLabel(
"Notes", userNotesSection_);
607 notesTitle->setStyleSheet(
608 QString(
"font-weight: bold; color: %1; font-size: 10px;").arg(c.
textSecondary.name()));
609 notesLayout->addWidget(notesTitle);
611 userNotesLabel_ =
new QLabel(userNotesSection_);
612 userNotesLabel_->setStyleSheet(QString(
"color: %1; font-size: 10px; padding: 6px; "
613 "border: 1px dashed %2; border-radius: 4px; "
614 "background-color: %3;")
618 userNotesLabel_->setWordWrap(
true);
619 userNotesLabel_->setCursor(Qt::PointingHandCursor);
620 userNotesLabel_->setToolTip(
"Click to edit notes");
622 userNotesLabel_->installEventFilter(
this);
623 notesLayout->addWidget(userNotesLabel_);
625 userNotesSection_->setVisible(
false);
626 notesSection_->addWidget(userNotesSection_);
628 contentLayout->addWidget(notesSection_);
635 new CollapsibleSection(
"System",
"details/system_collapsed",
true, contentWidget);
638 runningInfoContainer_ =
new QWidget(contentWidget);
639 runningInfoContainer_->setVisible(
false);
640 runningInfoContainer_->setStyleSheet(
641 QString(
"background-color: %1; border-radius: 4px; margin-top: 10px;")
643 QVBoxLayout* runningLayout =
new QVBoxLayout(runningInfoContainer_);
644 runningLayout->setContentsMargins(0, 0, 0, 0);
645 runningLayout->setSpacing(0);
648 gameRunningInfoLabel_ =
new QLabel(runningInfoContainer_);
649 gameRunningInfoLabel_->setStyleSheet(
650 QString(
"color: %1; font-size: 10px; padding: 10px; background: transparent;")
652 gameRunningInfoLabel_->setAlignment(Qt::AlignLeft | Qt::AlignTop);
653 gameRunningInfoLabel_->setWordWrap(
true);
654 gameRunningInfoLabel_->setTextFormat(Qt::RichText);
655 runningLayout->addWidget(gameRunningInfoLabel_);
658 frameMetricsWidget_ =
new FrameMetricsWidget(runningInfoContainer_);
659 frameMetricsWidget_->setVisible(
false);
660 frameMetricsWidget_->setTargetFps(144.0);
661 runningLayout->addWidget(frameMetricsWidget_);
663 systemSection_->addWidget(runningInfoContainer_);
666 systemInfoLabel_ =
new QLabel(contentWidget);
667 systemInfoLabel_->setStyleSheet(
668 QString(
"color: %1; font-size: 10px; margin-top: 10px; padding: 8px; "
669 "background-color: %2; border-radius: 4px;")
672 systemInfoLabel_->setAlignment(Qt::AlignLeft | Qt::AlignTop);
673 systemInfoLabel_->setWordWrap(
true);
674 systemInfoLabel_->setTextFormat(Qt::RichText);
675 systemInfoLabel_->setVisible(
false);
676 systemSection_->addWidget(systemInfoLabel_);
678 contentLayout->addWidget(systemSection_);
686 downloadProgressWidget_ =
new QWidget(contentWidget);
687 QVBoxLayout* progressLayout =
new QVBoxLayout(downloadProgressWidget_);
688 progressLayout->setContentsMargins(0, 8, 0, 8);
689 progressLayout->setSpacing(4);
691 downloadProgressLabel_ =
new QLabel(downloadProgressWidget_);
692 downloadProgressLabel_->setStyleSheet(
693 QString(
"color: %1; font-size: 11px; font-weight: bold;").arg(c.
info.name()));
694 downloadProgressLabel_->setAlignment(Qt::AlignCenter);
695 progressLayout->addWidget(downloadProgressLabel_);
697 downloadProgressBar_ =
new QProgressBar(downloadProgressWidget_);
698 downloadProgressBar_->setMinimum(0);
699 downloadProgressBar_->setMaximum(100);
700 downloadProgressBar_->setValue(0);
701 downloadProgressBar_->setTextVisible(
false);
702 downloadProgressBar_->setMinimumHeight(8);
703 downloadProgressBar_->setMaximumHeight(8);
704 downloadProgressBar_->setStyleSheet(
705 QString(
"QProgressBar { background-color: %1; border-radius: 4px; }"
706 "QProgressBar::chunk { background-color: %2; border-radius: 4px; }")
708 .arg(c.
info.name()));
709 progressLayout->addWidget(downloadProgressBar_);
711 downloadProgressWidget_->setVisible(
false);
712 contentLayout->addWidget(downloadProgressWidget_);
715 updateBannerWidget_ =
new QWidget(contentWidget);
716 QHBoxLayout* updateBannerLayout =
new QHBoxLayout(updateBannerWidget_);
717 updateBannerLayout->setContentsMargins(8, 8, 8, 8);
718 updateBannerLayout->setSpacing(12);
720 updateBannerLabel_ =
new QLabel(
"⬆ Update Available", updateBannerWidget_);
721 updateBannerLabel_->setStyleSheet(
722 QString(
"color: %1; font-size: 12px; font-weight: bold;").arg(c.
warning.name()));
723 updateBannerLayout->addWidget(updateBannerLabel_, 1);
725 updateNowButton_ =
new QPushButton(
"Update Now", updateBannerWidget_);
726 updateNowButton_->setCursor(Qt::PointingHandCursor);
727 updateNowButton_->setStyleSheet(
728 QString(
"QPushButton { background-color: %1; color: %2; font-weight: bold; "
729 "border-radius: 4px; padding: 4px 12px; font-size: 11px; }"
730 "QPushButton:hover { background-color: %3; }")
733 .arg(c.
warning.lighter(110).name()));
734 connect(updateNowButton_, &QPushButton::clicked,
this,
748 updateBannerLayout->addWidget(updateNowButton_);
750 updateBannerWidget_->setStyleSheet(
751 QString(
"background-color: %1; border-radius: 6px; border: 1px solid %2;")
752 .arg(c.
warning.darker(200).name())
753 .arg(c.
warning.darker(150).name()));
754 updateBannerWidget_->setVisible(
false);
755 contentLayout->addWidget(updateBannerWidget_);
757 contentLayout->addStretch();
759 detailsScrollArea->setWidget(contentWidget);
760 detailsLayout->addWidget(detailsScrollArea, 1);
772 heroImageLabel_->setVisible(
false);
773 logoImageLabel_->setVisible(
false);
774 coverArtLabel_->setVisible(
false);
775 gameNameLabel_->setText(
"Select a Game");
776 gameInfoLabel_->setText(
"Choose a game from the list to see details");
777 gameGenresLabel_->setVisible(
false);
778 gameStatsLabel_->clear();
779 gameSteamInfoLabel_->setVisible(
false);
780 gameDescLabel_->setVisible(
false);
781 gameLaunchConfigLabel_->setVisible(
false);
782 runningInfoContainer_->setVisible(
false);
783 systemInfoLabel_->setVisible(
false);
785 if (overviewSection_)
786 overviewSection_->setVisible(
false);
787 if (statisticsSection_)
788 statisticsSection_->setVisible(
false);
789 completionProgressBar_->setVisible(
false);
790 hltbSection_->setVisible(
false);
791 sessionHistorySection_->setVisible(
false);
792 userNotesSection_->setVisible(
false);
793 configPresetsSection_->setVisible(
false);
794 collectionsLabel_->setVisible(
false);
795 if (updateBannerWidget_)
796 updateBannerWidget_->setVisible(
false);
797 launchButton_->setEnabled(
false);
798 stopButton_->setVisible(
false);
799 configButton_->setEnabled(
false);
803 const Game* game = libCtrl_->getGame(gameId);
809 gameNameLabel_->setText(QString::fromStdString(game->
name));
810 configButton_->setEnabled(
true);
811 if (statisticsSection_)
812 statisticsSection_->setVisible(
true);
816 const QPixmap heroPixmap =
817 imgCache_ ? imgCache_->getHeroImage(game, detailsPanel_->width()) : QPixmap();
818 if (!heroPixmap.isNull())
820 heroImageLabel_->setPixmap(heroPixmap);
823 heroImageLabel_->setFixedHeight(
824 static_cast<int>(qRound(heroPixmap.deviceIndependentSize().height())));
825 heroImageLabel_->setVisible(
true);
829 heroImageLabel_->setVisible(
false);
834 if (!logoPath.isEmpty() && heroImageLabel_->isVisible())
836 QPixmap logoPixmap(logoPath);
837 if (!logoPixmap.isNull())
840 int heroHeight = heroImageLabel_->height();
841 int heroWidth = heroImageLabel_->width();
842 int maxLogoWidth =
static_cast<int>(heroWidth * 0.4);
843 int maxLogoHeight =
static_cast<int>(heroHeight * 0.5);
845 QPixmap scaledLogo = logoPixmap.scaled(maxLogoWidth, maxLogoHeight, Qt::KeepAspectRatio,
846 Qt::SmoothTransformation);
848 logoImageLabel_->setPixmap(scaledLogo);
849 logoImageLabel_->setFixedSize(scaledLogo.size());
853 logoImageLabel_->move(padding, heroHeight - scaledLogo.height() - padding);
854 logoImageLabel_->setVisible(
true);
858 logoImageLabel_->setVisible(
false);
863 logoImageLabel_->setVisible(
false);
879 info <<
"Installing...";
883 info <<
"Not Installed";
894 info << QString(
"Published by %1").arg(QString::fromStdString(game->
metadata.
publisher));
900 gameInfoLabel_->setText(info.join(
" • "));
908 genres << QString::fromStdString(genre);
910 gameGenresLabel_->setText(genres.join(
" • "));
911 gameGenresLabel_->setVisible(
true);
915 gameGenresLabel_->setVisible(
false);
920 const auto& sc = themeMgr_->colors();
927 QString(
"<div style='text-align:center;'>"
928 "<span style='font-size:20px; font-weight:bold; color:%1;'>%2</span><br>"
929 "<span style='font-size:10px; color:%3;'>Total Playtime</span></div>")
930 .arg(sc.textPrimary.name(),
935 QStringList secondary;
941 secondary << QString(
"Last: %1").arg(lastPlayed.toString(
"MMM d, yyyy"));
948 secondary << QString(
"%1 GB").arg(sizeGB, 0,
'f', 1);
951 double sizeMB =
static_cast<double>(game->
installSizeBytes) / (1024.0 * 1024.0);
952 secondary << QString(
"%1 MB").arg(sizeMB, 0,
'f', 0);
957 uint64_t available = getCachedDiskSpace(game->
installPath);
960 double availGB =
static_cast<double>(available) / (1024.0 * 1024.0 * 1024.0);
961 secondary << QString(
"%1 GB free").arg(availGB, 0,
'f', 0);
966 secondary << QString(
"%1 crash%2")
970 if (!secondary.isEmpty())
972 html += QString(
"<div style='text-align:center; font-size:11px; color:%1; "
973 "margin-top:4px;'>%2</div>")
974 .arg(sc.textSecondary.name(), secondary.join(
" | "));
977 gameStatsLabel_->setText(html);
983 QStringList steamInfo;
989 QString cloudStatus =
"☁ Cloud Saves";
1006 cloudStatus += QString(
" (%1 MB)").arg(sizeMB, 0,
'f', 1);
1009 steamInfo << cloudStatus;
1013 steamInfo <<
"☁ Cloud (disabled)";
1019 int installedDlc = 0;
1025 if (installedDlc ==
static_cast<int>(game->
metadata.
dlc.size()))
1027 steamInfo << QString(
"%1 DLC").arg(game->
metadata.
dlc.size());
1031 steamInfo << QString(
"%1/%2 DLC").arg(installedDlc).arg(game->
metadata.
dlc.size());
1038 steamInfo <<
"⬆ Update Available";
1044 QStringList categories;
1049 steamInfo << categories.join(
", ");
1051 gameSteamInfoLabel_->setText(steamInfo.join(
" | "));
1052 gameSteamInfoLabel_->setVisible(
true);
1056 gameSteamInfoLabel_->setVisible(
false);
1064 QString tierCapitalized = tierText.left(1).toUpper() + tierText.mid(1);
1068 if (tierText ==
"platinum")
1069 tierColor =
"#b4c7dc";
1070 else if (tierText ==
"gold")
1071 tierColor =
"#cfb53b";
1072 else if (tierText ==
"silver")
1073 tierColor =
"#a6a6a6";
1074 else if (tierText ==
"bronze")
1075 tierColor =
"#cd7f32";
1076 else if (tierText ==
"borked")
1077 tierColor = tc.
error.name();
1078 else if (tierText ==
"native")
1079 tierColor = tc.
success.name();
1083 QString protondbHtml = QString(
"<span style='color: %1;'>ProtonDB: </span>"
1084 "<span style='color: %2; font-weight: bold;'>%3</span>")
1085 .arg(tc.
textMuted.name(), tierColor, tierCapitalized);
1091 QString(
" <span style='color: %1;'>(%2 confidence)</span>")
1097 QString currentSteamInfo = gameSteamInfoLabel_->text();
1098 if (!currentSteamInfo.isEmpty())
1100 gameSteamInfoLabel_->setText(currentSteamInfo +
" | " + protondbHtml);
1104 gameSteamInfoLabel_->setText(protondbHtml);
1105 gameSteamInfoLabel_->setVisible(
true);
1115 if (desc.length() > 200)
1117 desc = desc.left(200) +
"...";
1119 gameDescLabel_->setText(desc.toHtmlEscaped());
1120 gameDescLabel_->setVisible(
true);
1121 if (overviewSection_)
1122 overviewSection_->setVisible(
true);
1126 gameDescLabel_->setVisible(
false);
1127 if (overviewSection_)
1128 overviewSection_->setVisible(
false);
1139 completionStatusCombo_->findData(
static_cast<int>(game->
completionStatus));
1140 if (statusIndex >= 0)
1142 QSignalBlocker blocker(completionStatusCombo_);
1143 completionStatusCombo_->setCurrentIndex(statusIndex);
1151 int progressPercent = qMin(100,
static_cast<int>((playedHours / targetHours) * 100));
1153 completionProgressBar_->setValue(progressPercent);
1156 QString progressColor = tc.
accent.name();
1161 progressColor = tc.
success.name();
1164 progressColor = tc.
error.name();
1167 progressColor = tc.
warning.name();
1172 completionProgressBar_->setStyleSheet(
1173 QString(
"QProgressBar { background-color: %1; border-radius: 2px; }"
1174 "QProgressBar::chunk { background-color: %2; border-radius: 2px; }")
1176 completionProgressBar_->setVisible(
true);
1180 completionProgressBar_->setVisible(
false);
1190 hltbExtrasLabel_->setText(
1192 hltbCompleteLabel_->setText(
1195 hltbSection_->setVisible(
true);
1199 hltbSection_->setVisible(
false);
1208 auto sessions = libCtrl_->getRecentSessions(gameId, 20);
1209 if (!sessions.empty())
1212 Game* mutableGame = libCtrl_->getGameForEdit(gameId);
1224 QString sessionsHtml;
1231 const auto& session = *it;
1232 QDateTime startTime = QDateTime::fromSecsSinceEpoch(session.startTime);
1233 QString duration = QString::fromStdString(session.getFormattedDuration());
1234 QString dateStr = startTime.toString(
"MMM d");
1236 sessionsHtml += QString(
"<span style='color: %1;'>%2</span> - %3")
1237 .arg(tc.
textMuted.name(), dateStr, duration);
1240 if (session.avgFps > 0)
1242 sessionsHtml += QString(
" <span style='color: %1;'>(%2 avg FPS)</span>")
1243 .arg(tc.
info.name())
1244 .arg(session.avgFps, 0,
'f', 0);
1248 if (session.exitReason ==
"crash")
1251 QString(
" <span style='color: %1;'>crashed</span>").arg(tc.
error.name());
1256 sessionsHtml +=
"<br>";
1260 sessionHistoryLabel_->setText(sessionsHtml);
1261 sessionHistorySection_->setVisible(
true);
1265 sessionHistorySection_->setVisible(
false);
1273 QString notes = QString::fromStdString(game->
userNotes);
1274 if (notes.length() > 150)
1276 notes = notes.left(147) +
"...";
1278 userNotesLabel_->setText(notes);
1279 userNotesSection_->setVisible(
true);
1283 userNotesLabel_->setText(
"Add notes...");
1284 userNotesSection_->setVisible(
true);
1291 while (QLayoutItem* item = presetsButtonLayout_->takeAt(0))
1293 delete item->widget();
1303 QPushButton* presetBtn =
1304 new QPushButton(QString::fromStdString(name), configPresetsSection_);
1305 presetBtn->setMaximumHeight(24);
1306 presetBtn->setCursor(Qt::PointingHandCursor);
1311 presetBtn->setStyleSheet(
1312 QString(
"QPushButton { background-color: %1; color: %2; border: none; "
1313 "border-radius: 3px; padding: 2px 8px; font-size: 10px; font-weight: "
1319 presetBtn->setStyleSheet(
1320 QString(
"QPushButton { background-color: %1; color: %2; border: 1px solid %3; "
1321 "border-radius: 3px; padding: 2px 8px; font-size: 10px; }"
1322 "QPushButton:hover { background-color: %4; border-color: %5; }")
1328 QString presetName = QString::fromStdString(name);
1329 connect(presetBtn, &QPushButton::clicked,
this,
1330 [
this, presetName]()
1338 std::string templateName = presetName.toStdString();
1350 presetsButtonLayout_->addWidget(presetBtn);
1352 presetsButtonLayout_->addStretch();
1353 configPresetsSection_->setVisible(
true);
1357 configPresetsSection_->setVisible(
false);
1369 badges << QString(
"<span style='background-color: %1; color: %2; padding: 1px 6px; "
1370 "border-radius: 3px; font-size: 9px;'>%3</span>")
1371 .arg(tc.
accent.name(),
"white",
1372 QString::fromStdString(collection).toHtmlEscaped());
1374 collectionsLabel_->setText(badges.join(
" "));
1375 collectionsLabel_->setVisible(
true);
1379 collectionsLabel_->setVisible(
false);
1383 QString launchConfig;
1388 QString labelColor = tc.
textMuted.name();
1390 QString accentColor = tc.
accent.name();
1391 QString infoColor = tc.
info.name();
1392 QString warnColor = tc.
warning.name();
1393 QString successColor = tc.
success.name();
1396 auto addRow = [&launchConfig, &labelColor](
const QString& label,
const QString& value,
1397 const QString& valColor)
1400 QString(
"<tr><td style='color: %1; padding-right: 12px; white-space: nowrap;'>%2</td>"
1401 "<td style='color: %3;'>%4</td></tr>")
1402 .arg(labelColor, label, valColor, value);
1406 auto truncatePath = [](
const QString& path,
int maxLen) -> QString
1408 if (path.length() > maxLen)
1409 return "..." + path.right(maxLen - 3);
1414 launchConfig += QString(
"<b style='color: %1;'>Launch Configuration</b>").arg(accentColor);
1417 if (config.useSteamDefaults)
1420 QString(
"<br><span style='color: %1;'>Using Steam defaults</span>").arg(warnColor);
1424 launchConfig +=
"<table style='margin-top: 8px; border-spacing: 0 4px;'>";
1427 QStringList wrappers;
1428 if (config.enableMangoHud)
1429 wrappers <<
"MangoHud";
1430 if (config.enableGameMode)
1431 wrappers <<
"GameMode";
1432 if (config.enableGamePerformance)
1433 wrappers <<
"game-performance";
1434 if (config.enableVkBasalt)
1435 wrappers <<
"VkBasalt";
1438 if (!config.executablePath.empty())
1440 QString exe = truncatePath(QString::fromStdString(config.executablePath), 45);
1441 addRow(
"Executable", exe, valueColor);
1445 if (!config.workingDirectory.empty())
1447 QString workDir = truncatePath(QString::fromStdString(config.workingDirectory), 45);
1448 addRow(
"Work Dir", workDir, valueColor);
1452 if (!config.arguments.empty())
1454 QString args = QString::fromStdString(config.arguments);
1455 if (args.length() > 50)
1456 args = args.left(47) +
"...";
1457 addRow(
"Arguments", args, valueColor);
1461 if (!config.runnerType.empty())
1463 QString runner = QString::fromStdString(config.runnerType);
1464 if (!config.runnerVersion.empty())
1466 runner += QString(
" (%1)").arg(QString::fromStdString(config.runnerVersion));
1468 addRow(
"Runner", runner, valueColor);
1474 if (!config.protonVersion.empty() && config.protonVersion !=
"Proton (Steam-managed)" &&
1475 config.protonVersion != config.runnerVersion)
1477 addRow(
"Proton", QString::fromStdString(config.protonVersion), infoColor);
1480 if (!config.winePrefix.empty())
1482 QString prefix = truncatePath(QString::fromStdString(config.winePrefix), 40);
1483 addRow(
"Wine Prefix", prefix, valueColor);
1486 if (!config.winePath.empty())
1488 QString winePath = truncatePath(QString::fromStdString(config.winePath), 40);
1489 addRow(
"Wine Path", winePath, valueColor);
1492 if (!config.wineDLL.empty())
1494 addRow(
"DLL Overrides", QString::fromStdString(config.wineDLL), warnColor);
1498 if (config.useVirtualDesktop)
1500 addRow(
"Virtual Desktop",
1501 QString(
"%1x%2").arg(config.virtualDesktopWidth).arg(config.virtualDesktopHeight),
1506 if (!wrappers.isEmpty())
1508 addRow(
"Wrappers", wrappers.join(
", "), successColor);
1512 if (config.enableFsync)
1514 addRow(
"Sync",
"Fsync", successColor);
1516 else if (config.autoDetectSync)
1518 addRow(
"Sync",
"Auto-detect", labelColor);
1522 if (config.enableDetailedLogging)
1524 addRow(
"Logging",
"Detailed (debug)", warnColor);
1528 if (!config.excludeProcesses.empty())
1530 QStringList excluded;
1531 for (
const auto& proc : config.excludeProcesses)
1533 excluded << QString::fromStdString(proc);
1535 QString excludeStr = excluded.join(
", ");
1536 if (excludeStr.length() > 40)
1537 excludeStr = excludeStr.left(37) +
"...";
1538 addRow(
"Exclude", excludeStr, labelColor);
1541 launchConfig +=
"</table>";
1544 if (!config.environmentVariables.empty())
1546 launchConfig += QString(
"<div style='margin-top: 8px;'><span style='color: "
1547 "%1;'>Environment Variables</span></div>")
1549 launchConfig +=
"<table style='margin-top: 4px; border-spacing: 0 2px;'>";
1550 for (
const auto& [key, value] : config.environmentVariables)
1552 QString envKey = QString::fromStdString(key).toHtmlEscaped();
1553 QString envVal = QString::fromStdString(value);
1554 if (envVal.length() > 35)
1555 envVal = envVal.left(32) +
"...";
1557 QString(
"<tr><td style='color: %1; padding-right: 8px;'>%2</td>"
1558 "<td style='color: %3;'>=</td>"
1559 "<td style='color: %4; padding-left: 4px;'>%5</td></tr>")
1560 .arg(accentColor, envKey, labelColor, valueColor, envVal.toHtmlEscaped());
1562 launchConfig +=
"</table>";
1566 bool hasConfig = !config.executablePath.empty() || !config.protonVersion.empty() ||
1567 !wrappers.isEmpty() || !config.environmentVariables.empty() ||
1568 !config.runnerType.empty() || config.useSteamDefaults;
1571 gameLaunchConfigLabel_->setText(launchConfig);
1572 gameLaunchConfigLabel_->setVisible(
true);
1576 gameLaunchConfigLabel_->setVisible(
false);
1580 bool isRunning = launchCtrl_->isGameRunning(gameId);
1583 QString runningInfo;
1586 auto duration = launchCtrl_->getSessionDuration(gameId);
1587 long long totalSecs =
static_cast<long long>(duration.count());
1588 int hours =
static_cast<int>(totalSecs / 3600);
1589 int minutes =
static_cast<int>((totalSecs % 3600) / 60);
1590 int seconds =
static_cast<int>(totalSecs % 60);
1591 QString durationStr;
1593 durationStr = QString(
"%1h %2m %3s").arg(hours).arg(minutes).arg(seconds);
1594 else if (minutes > 0)
1595 durationStr = QString(
"%1m %2s").arg(minutes).arg(seconds);
1597 durationStr = QString(
"%1s").arg(seconds);
1605 runningInfo += QString(
"<b style='color: %1;'>▶ Running</b>").arg(successColor);
1606 runningInfo += QString(
" <span style='color: %1;'>%2</span>")
1610 if (frameMetrics.isValid(5000) || frameMetrics.sample_count > 0)
1613 bool isStale = !frameMetrics.isValid(2000);
1614 bool isVeryStale = !frameMetrics.isValid(5000);
1615 int64_t ageMs = frameMetrics.getAgeMs();
1619 double targetFps = 144.0;
1621 if (frameMetrics.fps >= targetFps * 0.95)
1623 else if (frameMetrics.fps >= targetFps * 0.5)
1626 fpsColor = tc.
error.name();
1628 QString metricsValueColor = valueColor;
1629 QString staleIndicator;
1635 metricsValueColor = tc.
textMuted.name();
1637 QString(
"<span style='color: %1; font-size: 9px;'> ⚠ stale (%2s)</span>")
1638 .arg(tc.
error.name())
1639 .arg(
static_cast<double>(ageMs) / 1000.0, 0,
'f', 0);
1647 QString(
"<span style='color: %1; font-size: 9px;'> (%2s ago)</span>")
1649 .arg(
static_cast<double>(ageMs) / 1000.0, 0,
'f', 1);
1652 runningInfo +=
"<table style='margin-top: 8px; border-spacing: 0 4px;'>";
1655 if (frameMetrics.fps_avg > 0)
1657 QString avgFpsColor = fpsColor;
1658 if (frameMetrics.fps_avg >= targetFps * 0.95)
1659 avgFpsColor = tc.
success.name();
1660 else if (frameMetrics.fps_avg >= targetFps * 0.5)
1661 avgFpsColor = tc.
warning.name();
1663 avgFpsColor = tc.
error.name();
1668 avgFpsColor = tc.
warning.name();
1672 "<tr><td style='color: %1; padding-right: 12px; vertical-align: "
1673 "baseline;'>Avg FPS</td>"
1674 "<td style='color: %2; font-weight: bold; font-size: %5px;'>%3%4</td></tr>")
1675 .arg(labelColor, avgFpsColor)
1676 .arg(frameMetrics.fps_avg, 0,
'f', 1)
1677 .arg(staleIndicator)
1678 .arg(themeMgr_->scaledFontSize(18));
1685 "<tr><td style='color: %1; padding-right: 12px; vertical-align: "
1686 "baseline;'>FPS</td>"
1687 "<td style='color: %2; font-weight: bold; font-size: %5px;'>%3%4</td></tr>")
1688 .arg(labelColor, fpsColor)
1689 .arg(frameMetrics.fps, 0,
'f', 1)
1690 .arg(staleIndicator)
1691 .arg(themeMgr_->scaledFontSize(18));
1695 runningInfo += QString(
"<tr><td style='color: %1; padding-right: 12px;'>Current</td>"
1696 "<td style='color: %2;'>%3 FPS</td></tr>")
1697 .arg(labelColor, metricsValueColor)
1698 .arg(frameMetrics.fps, 0,
'f', 1);
1701 runningInfo += QString(
"<tr><td style='color: %1; padding-right: 12px;'>Frametime</td>"
1702 "<td style='color: %2;'>%3 ms</td></tr>")
1703 .arg(labelColor, metricsValueColor)
1704 .arg(frameMetrics.frametime_ms, 0,
'f', 2);
1707 if (frameMetrics.fps_1_low > 0)
1709 QString lowColor = metricsValueColor;
1710 if (!isStale && !isVeryStale && frameMetrics.fps_1_low < targetFps * 0.5)
1714 QString(
"<tr><td style='color: %1; padding-right: 12px;'>1%% Low</td>"
1715 "<td style='color: %2;'>%3 FPS</td></tr>")
1716 .arg(labelColor, lowColor)
1717 .arg(frameMetrics.fps_1_low, 0,
'f', 1);
1721 if (frameMetrics.fps_0_1_low > 0)
1723 QString lowColor = metricsValueColor;
1724 if (!isStale && !isVeryStale && frameMetrics.fps_0_1_low < targetFps * 0.4)
1728 QString(
"<tr><td style='color: %1; padding-right: 12px;'>0.1%% Low</td>"
1729 "<td style='color: %2;'>%3 FPS</td></tr>")
1730 .arg(labelColor, lowColor)
1731 .arg(frameMetrics.fps_0_1_low, 0,
'f', 1);
1734 runningInfo +=
"</table>";
1736 else if (collecting)
1738 runningInfo += QString(
"<div style='margin-top: 8px;'>"
1739 "<span style='color: %1;'>Collecting frame data...</span></div>")
1744 QStringList activeOpts;
1745 if (config.enableMangoHud || collecting)
1746 activeOpts <<
"MangoHud";
1747 if (config.enableGameMode)
1748 activeOpts <<
"GameMode";
1749 if (config.enableGamePerformance)
1750 activeOpts <<
"game-performance";
1751 if (config.enableVkBasalt)
1752 activeOpts <<
"VkBasalt";
1753 if (config.enableFsync)
1754 activeOpts <<
"Fsync";
1756 if (!config.protonVersion.empty() && config.protonVersion !=
"Proton (Steam-managed)")
1757 activeOpts << QString::fromStdString(config.protonVersion);
1759 if (!activeOpts.isEmpty())
1761 runningInfo += QString(
"<div style='margin-top: 8px;'>"
1762 "<span style='color: %1; font-size: 10px;'>%2</span></div>")
1763 .arg(tc.
textMuted.name(), activeOpts.join(
" · "));
1767 if (!frameMetrics.frametimeHistory.empty())
1769 frameMetricsWidget_->setMetrics(frameMetrics);
1770 frameMetricsWidget_->setVisible(
true);
1774 frameMetricsWidget_->setVisible(
false);
1781 int launcherPid = process->getProcessId();
1782 int trackedPid = process->getTrackedProcessId();
1783 QString trackedName = QString::fromStdString(process->getTrackedProcessName());
1786 runningInfo += QString(
"<br><br><b style='color: %1;'>Process Tree</b>").arg(infoColor);
1787 runningInfo +=
"<table style='margin-top: 4px; border-spacing: 0 2px;'>";
1789 if (trackedPid > 0 && trackedPid != launcherPid)
1792 runningInfo += QString(
"<tr><td style='color: %1;'>Launcher</td>"
1793 "<td style='color: %2; padding-left: 8px;'>PID %3</td></tr>")
1794 .arg(labelColor, valueColor)
1796 runningInfo += QString(
"<tr><td style='color: %1;'>└─ %2</td>"
1797 "<td style='color: %3; padding-left: 8px;'>PID %4</td></tr>")
1798 .arg(successColor, trackedName.isEmpty() ?
"Game" : trackedName,
1805 QString procName = trackedName.isEmpty() ?
"Game" : trackedName;
1806 runningInfo += QString(
"<tr><td style='color: %1;'>%2</td>"
1807 "<td style='color: %3; padding-left: 8px;'>PID %4</td></tr>")
1808 .arg(successColor, procName, successColor)
1811 runningInfo +=
"</table>";
1814 int targetPid = (trackedPid > 0) ? trackedPid : launcherPid;
1817 if (runtimeInfo.
valid)
1821 if (!keyEnv.empty())
1824 QString(
"<br><b style='color: %1;'>Runtime Environment</b>").arg(infoColor);
1825 runningInfo +=
"<table style='margin-top: 4px; border-spacing: 0 1px;'>";
1827 for (
const auto& [key, value] : keyEnv)
1829 QString envVal = QString::fromStdString(value);
1830 if (envVal.length() > 30)
1831 envVal = envVal.left(27) +
"...";
1833 QString(
"<tr><td style='color: %1; padding-right: 6px; font-size: "
1835 "<td style='color: %3; font-size: 10px;'>= %4</td></tr>")
1836 .arg(accentColor, QString::fromStdString(key).toHtmlEscaped(),
1837 valueColor, envVal.toHtmlEscaped());
1838 if (++envCount >= 10)
1840 runningInfo += QString(
"<tr><td colspan='2' style='color: %1; "
1841 "font-size: 9px;'>... and %2 more</td></tr>")
1843 .arg(
static_cast<int>(keyEnv.size()) - envCount);
1847 runningInfo +=
"</table>";
1851 std::vector<std::string> configuredEnv;
1852 configuredEnv.reserve(config.environmentVariables.size());
1853 for (
const auto& [key, value] : config.environmentVariables)
1855 configuredEnv.push_back(key +
"=" + value);
1859 if (!differences.empty())
1861 runningInfo += QString(
"<br><span style='color: %1; font-size: 10px;'>Config "
1862 "Differences:</span>")
1864 runningInfo +=
"<table style='border-spacing: 0 1px;'>";
1866 for (
const auto& diff : differences)
1869 QString(
"<tr><td style='color: %1; font-size: 9px;'>%2</td></tr>")
1870 .arg(warnColor, QString::fromStdString(diff).toHtmlEscaped());
1871 if (++diffCount >= 5)
1874 QString(
"<tr><td style='color: %1; font-size: 9px;'>... and %2 "
1877 .arg(
static_cast<int>(differences.size()) - diffCount);
1881 runningInfo +=
"</table>";
1887 QString cmdLine = QString::fromStdString(runtimeInfo.
commandLine);
1888 if (cmdLine.length() > 80)
1889 cmdLine = cmdLine.left(77) +
"...";
1891 QString(
"<br><span style='color: %1; font-size: 10px;'>cmd: </span>"
1892 "<span style='color: %2; font-size: 9px;'>%3</span>")
1893 .arg(labelColor, valueColor, cmdLine.toHtmlEscaped());
1898 runningInfo += QString(
"<br><span style='color: %1; font-size: 10px;'>Unable to "
1899 "read process environment (permission denied)</span>")
1904 gameRunningInfoLabel_->setText(runningInfo);
1905 runningInfoContainer_->setVisible(
true);
1909 runningInfoContainer_->setVisible(
false);
1910 frameMetricsWidget_->clear();
1911 frameMetricsWidget_->setVisible(
false);
1916 const auto& gpu = sysInfo.getGPUInfo();
1917 const auto& cpu = sysInfo.getCPUInfo();
1918 const auto& memory = sysInfo.getMemoryInfo();
1919 const auto& kernel = sysInfo.getKernelInfo();
1920 const auto& tools = sysInfo.getToolAvailability();
1922 QString sysInfoHtml;
1923 sysInfoHtml += QString(
"<b style='color: %1;'>System Info</b>").arg(labelColor);
1924 sysInfoHtml +=
"<table style='margin-top: 4px; border-spacing: 0 2px;'>";
1927 if (!gpu.model.empty() || !gpu.vendorName.empty())
1929 QString gpuStr = QString::fromStdString(gpu.model.empty() ? gpu.vendorName : gpu.model);
1932 gpuStr += QString(
" (%1 GB)").arg(gpu.vramMB / 1024);
1934 sysInfoHtml += QString(
"<tr><td style='color: %1; padding-right: 8px;'>GPU</td>"
1935 "<td style='color: %2;'>%3</td></tr>")
1936 .arg(labelColor, valueColor, gpuStr);
1940 if (!cpu.model.empty())
1943 QString cpuStr = QString::fromStdString(cpu.model);
1945 cpuStr.replace(
" 8-Core Processor",
"");
1946 cpuStr.replace(
" 16-Core Processor",
"");
1947 cpuStr.replace(
" Processor",
"");
1948 if (cpuStr.length() > 30)
1950 cpuStr = cpuStr.left(27) +
"...";
1952 cpuStr += QString(
" (%1C/%2T)").arg(cpu.coreCount).arg(cpu.threadCount);
1953 sysInfoHtml += QString(
"<tr><td style='color: %1; padding-right: 8px;'>CPU</td>"
1954 "<td style='color: %2;'>%3</td></tr>")
1955 .arg(labelColor, valueColor, cpuStr);
1959 if (memory.totalMB > 0)
1961 QString ramStr = QString(
"%1 GB").arg(memory.totalMB / 1024);
1962 sysInfoHtml += QString(
"<tr><td style='color: %1; padding-right: 8px;'>RAM</td>"
1963 "<td style='color: %2;'>%3</td></tr>")
1964 .arg(labelColor, valueColor, ramStr);
1968 if (!kernel.version.empty())
1970 QString kernelStr = QString::fromStdString(kernel.version);
1971 if (kernel.isCachyOS)
1972 kernelStr +=
" (CachyOS)";
1973 sysInfoHtml += QString(
"<tr><td style='color: %1; padding-right: 8px;'>Kernel</td>"
1974 "<td style='color: %2;'>%3</td></tr>")
1975 .arg(labelColor, valueColor, kernelStr);
1979 QStringList availableTools;
1981 availableTools <<
"MangoHud";
1983 availableTools <<
"GameMode";
1984 if (tools.gamePerformance)
1985 availableTools <<
"game-performance";
1986 if (tools.gamescope)
1987 availableTools <<
"Gamescope";
1989 availableTools <<
"VkBasalt";
1991 if (!availableTools.isEmpty())
1993 sysInfoHtml += QString(
"<tr><td style='color: %1; padding-right: 8px;'>Tools</td>"
1994 "<td style='color: %2;'>%3</td></tr>")
1995 .arg(labelColor, successColor, availableTools.join(
", "));
1999 if (kernel.supportsFsync)
2001 sysInfoHtml += QString(
"<tr><td style='color: %1; padding-right: 8px;'>Sync</td>"
2002 "<td style='color: %2;'>Fsync supported</td></tr>")
2003 .arg(labelColor, successColor);
2006 sysInfoHtml +=
"</table>";
2007 systemInfoLabel_->setText(sysInfoHtml);
2008 systemInfoLabel_->setVisible(
true);
2011 bool hasHeroImage = heroImageLabel_->isVisible();
2017 if (!coverPath.isEmpty())
2019 QPixmap coverPixmap = imgCache_ ? imgCache_->getGameThumbnail(game, QSize(200, 300),
2022 if (!coverPixmap.isNull())
2024 coverArtLabel_->setPixmap(coverPixmap);
2025 coverArtLabel_->setVisible(
true);
2029 coverArtLabel_->setText(
2030 QString(
"<div style='text-align:center; color:%1;'>"
2031 "<span style='font-family:%2; font-size:32px;'>%3</span><br>"
2032 "<span style='font-size:10px;'>No Cover Art</span></div>")
2035 coverArtLabel_->setVisible(
true);
2040 coverArtLabel_->setText(
2041 QString(
"<div style='text-align:center; color:%1;'>"
2042 "<span style='font-family:%2; font-size:32px;'>%3</span><br>"
2043 "<span style='font-size:10px;'>No Cover Art</span></div>")
2046 coverArtLabel_->setVisible(
true);
2052 coverArtLabel_->setVisible(
false);
2056 if (downloadProgressWidget_)
2058 bool showProgress =
false;
2064 showProgress =
true;
2072 bool isActivelyDownloading =
2076 if (isActivelyDownloading && progress.downloadProgress > 0)
2078 downloadProgressBar_->setValue(
2079 static_cast<int>(progress.downloadProgress * 100));
2083 QString speedText = QString::fromStdString(progress.getFormattedSpeed());
2084 if (progress.downloadSpeedBytesPerSec > 0)
2086 downloadProgressLabel_->setText(
2087 QString(
"%1 - %2% (%3)")
2089 .arg(
static_cast<int>(progress.downloadProgress * 100))
2094 downloadProgressLabel_->setText(
2097 .arg(
static_cast<int>(progress.downloadProgress * 100)));
2103 downloadProgressLabel_->setText(
"Waiting for Steam...");
2104 downloadProgressBar_->setValue(0);
2109 downloadProgressWidget_->setVisible(showProgress);
2113 if (updateBannerWidget_)
2115 bool showUpdateBanner =
false;
2122 showUpdateBanner =
true;
2125 updateBannerWidget_->setVisible(showUpdateBanner);
2139 if (gameId.empty() || !launchCtrl_->isGameRunning(gameId))
2141 runningInfoContainer_->setVisible(
false);
2142 frameMetricsWidget_->clear();
2143 frameMetricsWidget_->setVisible(
false);
2147 const Game* game = libCtrl_->getGame(gameId);
2153 QString labelColor = tc.
textMuted.name();
2155 QString accentColor = tc.
accent.name();
2156 QString infoColor = tc.
info.name();
2157 QString warnColor = tc.
warning.name();
2158 QString successColor = tc.
success.name();
2163 QString runningInfo;
2166 auto duration = launchCtrl_->getSessionDuration(gameId);
2167 long long totalSecs =
static_cast<long long>(duration.count());
2168 int hours =
static_cast<int>(totalSecs / 3600);
2169 int minutes =
static_cast<int>((totalSecs % 3600) / 60);
2170 int seconds =
static_cast<int>(totalSecs % 60);
2171 QString durationStr;
2173 durationStr = QString(
"%1h %2m %3s").arg(hours).arg(minutes).arg(seconds);
2174 else if (minutes > 0)
2175 durationStr = QString(
"%1m %2s").arg(minutes).arg(seconds);
2177 durationStr = QString(
"%1s").arg(seconds);
2184 runningInfo += QString(
"<b style='color: %1;'>▶ Running</b>").arg(successColor);
2186 QString(
" <span style='color: %1;'>%2</span>").arg(tc.
textSecondary.name(), durationStr);
2189 if (frameMetrics.isValid(5000) || frameMetrics.sample_count > 0)
2191 bool isStale = !frameMetrics.isValid(2000);
2192 bool isVeryStale = !frameMetrics.isValid(5000);
2193 int64_t ageMs = frameMetrics.getAgeMs();
2195 double targetFps = 144.0;
2197 if (frameMetrics.fps >= targetFps * 0.95)
2199 else if (frameMetrics.fps >= targetFps * 0.5)
2202 fpsColor = tc.
error.name();
2204 QString metricsValueColor = valueColor;
2205 QString staleIndicator;
2210 metricsValueColor = tc.
textMuted.name();
2211 staleIndicator = QString(
"<span style='color: %1; font-size: 9px;'> stale (%2s)</span>")
2212 .arg(tc.
error.name())
2213 .arg(
static_cast<double>(ageMs) / 1000.0, 0,
'f', 0);
2219 staleIndicator = QString(
"<span style='color: %1; font-size: 9px;'> (%2s ago)</span>")
2221 .arg(
static_cast<double>(ageMs) / 1000.0, 0,
'f', 1);
2224 runningInfo +=
"<table style='margin-top: 8px; border-spacing: 0 4px;'>";
2227 if (frameMetrics.fps_avg > 0)
2229 QString avgFpsColor = fpsColor;
2230 if (frameMetrics.fps_avg >= targetFps * 0.95)
2231 avgFpsColor = tc.
success.name();
2232 else if (frameMetrics.fps_avg >= targetFps * 0.5)
2233 avgFpsColor = tc.
warning.name();
2235 avgFpsColor = tc.
error.name();
2240 avgFpsColor = tc.
warning.name();
2243 QString(
"<tr><td style='color: %1; padding-right: 12px; vertical-align: "
2244 "baseline;'>Avg FPS</td>"
2245 "<td style='color: %2; font-weight: bold; font-size: %5px;'>%3%4</td></tr>")
2246 .arg(labelColor, avgFpsColor)
2247 .arg(frameMetrics.fps_avg, 0,
'f', 1)
2248 .arg(staleIndicator)
2249 .arg(themeMgr_->scaledFontSize(18));
2255 QString(
"<tr><td style='color: %1; padding-right: 12px; vertical-align: "
2256 "baseline;'>FPS</td>"
2257 "<td style='color: %2; font-weight: bold; font-size: %5px;'>%3%4</td></tr>")
2258 .arg(labelColor, fpsColor)
2259 .arg(frameMetrics.fps, 0,
'f', 1)
2260 .arg(staleIndicator)
2261 .arg(themeMgr_->scaledFontSize(18));
2265 runningInfo += QString(
"<tr><td style='color: %1; padding-right: 12px;'>Current</td>"
2266 "<td style='color: %2;'>%3 FPS</td></tr>")
2267 .arg(labelColor, metricsValueColor)
2268 .arg(frameMetrics.fps, 0,
'f', 1);
2271 runningInfo += QString(
"<tr><td style='color: %1; padding-right: 12px;'>Frametime</td>"
2272 "<td style='color: %2;'>%3 ms</td></tr>")
2273 .arg(labelColor, metricsValueColor)
2274 .arg(frameMetrics.frametime_ms, 0,
'f', 2);
2276 if (frameMetrics.fps_1_low > 0)
2278 QString lowColor = metricsValueColor;
2279 if (!isStale && !isVeryStale && frameMetrics.fps_1_low < targetFps * 0.5)
2282 runningInfo += QString(
"<tr><td style='color: %1; padding-right: 12px;'>1%% Low</td>"
2283 "<td style='color: %2;'>%3 FPS</td></tr>")
2284 .arg(labelColor, lowColor)
2285 .arg(frameMetrics.fps_1_low, 0,
'f', 1);
2288 if (frameMetrics.fps_0_1_low > 0)
2290 QString lowColor = metricsValueColor;
2291 if (!isStale && !isVeryStale && frameMetrics.fps_0_1_low < targetFps * 0.4)
2294 runningInfo += QString(
"<tr><td style='color: %1; padding-right: 12px;'>0.1%% Low</td>"
2295 "<td style='color: %2;'>%3 FPS</td></tr>")
2296 .arg(labelColor, lowColor)
2297 .arg(frameMetrics.fps_0_1_low, 0,
'f', 1);
2300 runningInfo +=
"</table>";
2302 else if (collecting)
2304 runningInfo += QString(
"<div style='margin-top: 8px;'>"
2305 "<span style='color: %1;'>Collecting frame data...</span></div>")
2310 QStringList activeOpts;
2311 if (config.enableMangoHud || collecting)
2312 activeOpts <<
"MangoHud";
2313 if (config.enableGameMode)
2314 activeOpts <<
"GameMode";
2315 if (config.enableGamePerformance)
2316 activeOpts <<
"game-performance";
2317 if (config.enableVkBasalt)
2318 activeOpts <<
"VkBasalt";
2319 if (config.enableFsync)
2320 activeOpts <<
"Fsync";
2322 if (!config.protonVersion.empty() && config.protonVersion !=
"Proton (Steam-managed)")
2323 activeOpts << QString::fromStdString(config.protonVersion);
2325 if (!activeOpts.isEmpty())
2327 runningInfo += QString(
"<div style='margin-top: 8px;'>"
2328 "<span style='color: %1; font-size: 10px;'>%2</span></div>")
2329 .arg(tc.
textMuted.name(), activeOpts.join(
" · "));
2333 if (!frameMetrics.frametimeHistory.empty())
2335 frameMetricsWidget_->setMetrics(frameMetrics);
2336 frameMetricsWidget_->setVisible(
true);
2340 frameMetricsWidget_->setVisible(
false);
2347 int launcherPid = process->getProcessId();
2348 int trackedPid = process->getTrackedProcessId();
2349 QString trackedName = QString::fromStdString(process->getTrackedProcessName());
2351 runningInfo += QString(
"<br><br><b style='color: %1;'>Process Tree</b>").arg(infoColor);
2352 runningInfo +=
"<table style='margin-top: 4px; border-spacing: 0 2px;'>";
2354 if (trackedPid > 0 && trackedPid != launcherPid)
2356 runningInfo += QString(
"<tr><td style='color: %1;'>Launcher</td>"
2357 "<td style='color: %2; padding-left: 8px;'>PID %3</td></tr>")
2358 .arg(labelColor, valueColor)
2360 runningInfo += QString(
"<tr><td style='color: %1;'>└─ %2</td>"
2361 "<td style='color: %3; padding-left: 8px;'>PID %4</td></tr>")
2363 (trackedName.isEmpty() ?
"Game" : trackedName).toHtmlEscaped(),
2369 QString procName = trackedName.isEmpty() ?
"Game" : trackedName;
2370 runningInfo += QString(
"<tr><td style='color: %1;'>%2</td>"
2371 "<td style='color: %3; padding-left: 8px;'>PID %4</td></tr>")
2372 .arg(successColor, procName.toHtmlEscaped(), successColor)
2375 runningInfo +=
"</table>";
2378 gameRunningInfoLabel_->setText(runningInfo);
2379 runningInfoContainer_->setVisible(
true);
2390 launchButton_->setEnabled(
false);
2391 launchButton_->setText(
"Launch");
2392 stopButton_->setVisible(
false);
2396 const Game* game = libCtrl_->getGame(gameId);
2399 launchButton_->setEnabled(
false);
2400 launchButton_->setText(
"Launch");
2401 stopButton_->setVisible(
false);
2411 launchButton_->setEnabled(
false);
2412 launchButton_->setText(
"Preparing...");
2413 stopButton_->setVisible(
false);
2417 launchButton_->setEnabled(
false);
2418 launchButton_->setText(
"Launching...");
2419 stopButton_->setVisible(
false);
2422 launchButton_->setEnabled(
false);
2423 launchButton_->setText(
"Running");
2424 stopButton_->setVisible(
true);
2428 launchButton_->setEnabled(
false);
2429 launchButton_->setText(
"Stopping...");
2430 stopButton_->setVisible(
false);
2442 launchButton_->setEnabled(
false);
2443 launchButton_->setText(
"Installing...");
2447 launchButton_->setEnabled(
true);
2460 launchButton_->setText(
2461 QString(
"Resume (%1%)")
2466 launchButton_->setText(
"Resume Download");
2471 launchButton_->setText(
"Install");
2477 launchButton_->setEnabled(
false);
2478 launchButton_->setText(
"Not Installed");
2483 launchButton_->setEnabled(
true);
2484 launchButton_->setText(
"Launch");
2486 stopButton_->setVisible(
false);
2505 detailsPanel_->setAutoFillBackground(
true);
2506 detailsPanel_->setBackgroundRole(QPalette::Window);
2510 if (overviewSection_)
2511 overviewSection_->applyTheme();
2512 if (statisticsSection_)
2513 statisticsSection_->applyTheme();
2514 if (configurationSection_)
2515 configurationSection_->applyTheme();
2517 notesSection_->applyTheme();
2519 systemSection_->applyTheme();
2522 if (heroImageLabel_)
2524 heroImageLabel_->setAutoFillBackground(
true);
2526 heroImageLabel_->setBackgroundRole(QPalette::AlternateBase);
2530 if (gameNameLabel_ && gameNameLabel_->parentWidget())
2532 QWidget* header = gameNameLabel_->parentWidget();
2533 header->setStyleSheet(QString(
"background-color: %1; border-bottom: 1px solid %2;")
2541 gameNameLabel_->setStyleSheet(QString(
"font-size: %2px; font-weight: bold; color: %1; "
2542 "background: transparent; border: none;")
2544 .arg(themeMgr_->scaledFontSize(18)));
2550 gameInfoLabel_->setStyleSheet(
2551 QString(
"color: %1; font-size: 11px; background: transparent; border: none;")
2556 if (gameGenresLabel_)
2558 gameGenresLabel_->setStyleSheet(
2559 QString(
"color: %1; font-size: 10px; background: transparent; border: none;")
2560 .arg(c.
info.name()));
2564 if (gameStatsLabel_)
2566 gameStatsLabel_->setStyleSheet(
2567 QString(
"color: %1; font-size: 10px;").arg(c.
textSecondary.name()));
2571 if (gameSteamInfoLabel_)
2573 gameSteamInfoLabel_->setStyleSheet(
2574 QString(
"color: %1; font-size: 10px;").arg(c.
info.name()));
2580 gameDescLabel_->setStyleSheet(
2581 QString(
"color: %1; font-size: 10px; margin-top: 8px; padding: 8px; "
2582 "background-color: %2; border-radius: 4px;")
2588 if (gameLaunchConfigLabel_)
2590 gameLaunchConfigLabel_->setStyleSheet(
2591 QString(
"color: %1; font-size: 10px; margin-top: 10px; padding: 10px; "
2592 "background-color: %2; border-radius: 4px; border: 1px solid %3;")
2601 launchButton_->setStyleSheet(
2602 QString(
"QPushButton { background-color: %1; color: %6; font-weight: bold; "
2603 "padding: 0 24px; border-radius: 6px; border: none; }"
2604 "QPushButton:hover { background-color: %2; }"
2605 "QPushButton:pressed { background-color: %3; }"
2606 "QPushButton:disabled { background-color: %4; color: %5; }")
2618 stopButton_->setStyleSheet(
2619 QString(
"QPushButton { background-color: %1; color: %5; font-weight: bold; "
2620 "padding: 0 24px; border-radius: 6px; border: none; }"
2621 "QPushButton:hover { background-color: %2; }"
2622 "QPushButton:pressed { background-color: %3; }"
2623 "QPushButton:disabled { background-color: %4; color: %6; }")
2624 .arg(c.
error.name())
2635 configButton_->setStyleSheet(
2636 QString(
"QPushButton { background-color: %1; color: %2; font-weight: bold; "
2637 "padding: 0 20px; border-radius: 6px; border: 1px solid %3; }"
2638 "QPushButton:hover { background-color: %4; border-color: %5; }"
2639 "QPushButton:disabled { color: %6; }")
2649 if (runningInfoContainer_)
2651 runningInfoContainer_->setStyleSheet(
2652 QString(
"background-color: %1; border-radius: 4px; margin-top: 10px;")
2657 if (gameRunningInfoLabel_)
2659 gameRunningInfoLabel_->setStyleSheet(
2660 QString(
"color: %1; font-size: 10px; padding: 10px; background: transparent;")
2665 if (systemInfoLabel_)
2667 systemInfoLabel_->setStyleSheet(
2668 QString(
"color: %1; font-size: 9px; margin-top: 10px; padding: 8px; "
2669 "background-color: %2; border-radius: 4px;")
2675 if (downloadProgressLabel_)
2677 downloadProgressLabel_->setStyleSheet(
2678 QString(
"color: %1; font-size: 11px; font-weight: bold;").arg(c.
info.name()));
2680 if (downloadProgressBar_)
2682 downloadProgressBar_->setStyleSheet(
2683 QString(
"QProgressBar { background-color: %1; border-radius: 4px; }"
2684 "QProgressBar::chunk { background-color: %2; border-radius: 4px; }")
2686 .arg(c.
info.name()));
2696 if (obj == userNotesLabel_ && event->type() == QEvent::MouseButtonRelease)
2706 QString currentNotes = QString::fromStdString(game->
userNotes);
2707 QString newNotes = QInputDialog::getMultiLineText(
2708 detailsPanel_,
"Edit Notes",
2709 QString(
"Notes for %1:").arg(QString::fromStdString(game->
name)), currentNotes, &ok);
2711 if (ok && newNotes != currentNotes)
2713 game->
userNotes = newNotes.toStdString();
2720 return QObject::eventFilter(obj, event);
2726uint64_t DetailsPanelManager::Impl::getCachedDiskSpace(
const std::string& path)
2728 auto now = std::chrono::steady_clock::now();
2729 auto it = diskSpaceCache_.find(path);
2731 if (it != diskSpaceCache_.end())
2734 auto age = std::chrono::duration_cast<std::chrono::seconds>(now - it->second.lastUpdate);
2735 if (age.count() < 30)
2737 return it->second.availableBytes;
2743 std::filesystem::space_info spaceInfo = std::filesystem::space(path, ec);
2744 uint64_t available = 0;
2745 if (!ec && spaceInfo.available > 0)
2747 available = spaceInfo.available;
2751 DiskSpaceCacheEntry cache;
2753 cache.availableBytes = available;
2754 cache.lastUpdate = now;
2755 diskSpaceCache_[path] = cache;
2769 impl_(std::make_unique<
Impl>(this, parent, libCtrl, launchCtrl, imgCache, themeManager))
2777 return impl_->detailsPanel();
2782 impl_->update(gameId);
2787 impl_->updateRunningInfo(gameId);
2792 impl_->updateLaunchButton(gameId);
2797 impl_->applyTheme();
2802 return impl_->frameMetricsWidget();
2807 return impl_->heroImageLabel();
2812 return impl_->downloadProgressWidget();
2817 return impl_->downloadProgressBar();
2822 return impl_->downloadProgressLabel();
2827 return impl_->launchButton();
QLabel * downloadProgressLabel() const
FrameMetricsWidget * frameMetricsWidget() const
QWidget * downloadProgressWidget() const
void updateRunningInfo(const std::string &gameId)
bool eventFilter(QObject *obj, QEvent *event) override
QWidget * detailsPanel() const
QPushButton * launchButton() const
std::string currentGameId_
QLabel * heroImageLabel() const
void update(const std::string &gameId)
QProgressBar * downloadProgressBar() const
Impl(DetailsPanelManager *owner, QWidget *parent, core::GameLibraryController *libCtrl, core::LaunchController *launchCtrl, GameThumbnailCache *imgCache, ThemeManager *themeMgr)
void updateLaunchButton(const std::string &gameId)
QWidget * widget() const
The root widget — slot into MainWindow's splitter.
QLabel * heroImageLabel() const
QProgressBar * downloadProgressBar() const
void update(const std::string &gameId)
Full refresh for a new selection. Safe with empty string (empty state).
~DetailsPanelManager() override
void updateRunningInfo(const std::string &gameId)
Lightweight refresh driven by the running-game timer; only touches FPS/frametime sections.
void applyTheme()
Re-read theme colours and restyle.
FrameMetricsWidget * frameMetricsWidget() const
Optional embed handle so MainWindow can wire the frame metrics timer.
QPushButton * launchButton() const
QLabel * downloadProgressLabel() const
void launchRequested(const std::string &gameId)
QWidget * downloadProgressWidget() const
DetailsPanelManager(QWidget *parent, core::GameLibraryController *libCtrl, core::LaunchController *launchCtrl, GameThumbnailCache *imgCache, ThemeManager *themeManager, QObject *qparent=nullptr)
void updateLaunchButton(const std::string &gameId)
Refresh only the Launch/Stop button state based on the launch state machine.
bool isCollecting(const std::string &gameId) const
Check if collection is active for a game.
FrameMetrics getMetrics(const std::string &gameId) const
Get current metrics for a game.
static FrameMetricsService & instance()
Get the singleton instance.
const GameProcess * getRunningProcess(const std::string &gameId) const
static GameProcessManager & instance()
Complete representation of a game in the library.
GameMetadata metadata
Descriptive information and media.
std::vector< PlaySession > recentSessions
Recent play sessions (last 20 kept in memory).
std::string userNotes
User's personal notes about the game.
std::vector< std::string > collections
Collections this game belongs to.
std::string installPath
Installation directory path.
CompletionStatus completionStatus
User's completion status.
std::string name
Display name shown in UI.
std::string getSourceName() const
Get human-readable source name.
GameStatistics statistics
Play statistics and usage tracking.
GameRunnerConfig runnerConfig
How to launch and run the game.
std::string getFormattedPlayTime() const
Format total play time as human-readable string.
GameStatus status
Current installation and execution status.
HowLongToBeatInfo hltbInfo
Time-to-beat estimates.
std::map< std::string, GameRunnerConfig > configTemplates
Named configuration templates (presets) that can be switched between Key is template name (e....
uint64_t installSizeBytes
Installation size in bytes.
bool isInstalled() const
Check if game is currently installed.
std::string activeTemplateName
Currently active template name (empty = using runnerConfig directly).
GameSource source
Where the game was acquired from (Steam, GOG, Local, etc.).
std::string getRunnerName() const
Get human-readable runner name.
std::string getImagePath(ImageType type) const
Get path for a specific image type.
static const QString & solidFamily()
Get the loaded Solid font family name.
static QString text(char32_t codepoint)
Convert a codepoint to a QString glyph.
static SteamDownloadProgress readGameState(uint32_t appId)
Read current state of a game directly from its appmanifest.
static SystemInfoService & instance()
Get singleton instance.
static QColor darkenColor(const QColor &color, int amount)
Darken a color by decreasing its lightness.
static QColor lightenColor(const QColor &color, int amount)
Lighten a color by increasing its lightness.
int scaledFontSize(int baseSize) const
Get scaled font size for given base size.
const ThemeColors & colors() const
Get effective colors (with accent customization applied).
@ Steam
Steam store/platform.
@ VerticalCover
Vertical cover art (600x900, portrait).
@ Logo
Game logo with transparency (PNG).
@ Installing
Game is being installed.
@ Installed
Game is installed and ready to play.
CompletionStatus
User's completion/play status for tracking backlog.
@ Played
Played but no clear completion criteria (e.g., multiplayer).
@ Completed
100% completion (achievements, side content, etc.)
@ Abandoned
Stopped playing, unlikely to return.
@ Beaten
Main story/campaign completed.
@ OnHold
Temporarily paused.
@ Playing
Currently playing.
@ NotPlayed
Never played (backlog).
constexpr char32_t Gamepad
bool isFullyInstalled(uint32_t flags)
Check if a game is fully installed.
bool needsUpdate(uint32_t flags)
Check if a game needs an update.
bool isDownloading(uint32_t flags)
Check if a game is currently downloading or updating.
constexpr uint32_t Staging
Staging files after download.
void openSteamUrlFromPanel(const QString &steamUrl)
Actual environment and command line read from a running process.
std::vector< std::string > compareWithConfigured(const std::vector< std::string > &configured) const
Compare configured vs actual environment.
static ActualRuntimeInfo readFromProcess(int processId)
Read actual runtime info from a process.
std::map< std::string, std::string > getKeyEnvironment() const
Get only gaming-related environment variables.
std::string commandLine
Full command line from /proc/pid/cmdline.
bool valid
Whether the read was successful.
uint64_t storageBytes
Cloud storage used in bytes.
bool enabled
Cloud saves enabled for this game.
bool supported
Game supports Steam Cloud.
int lastSyncState
0=synced, 1=uploading, 2=downloading, 3=error
double totalPlayTimeSeconds
Total play time in seconds (for all sessions).
time_t lastPlayed
Unix timestamp of last play session.
int timesLaunched
Number of times game was launched.
int crashCount
Number of times game has crashed.
double completionistHours
100% completion
bool found
Whether a match was found.
double mainPlusExtrasHours
Main + side content.
double mainStoryHours
Main story/campaign only.
Real-time download/installation progress for a Steam game.
double downloadProgress
Download progress (0.0 to 1.0).
uint32_t stateFlags
Current StateFlags.
@ Game
Game-specific fixes.