From dffb9100e5707474ee5a98bd0d294069a580137d Mon Sep 17 00:00:00 2001 From: Collecting Date: Mon, 5 Jan 2026 06:30:24 +0000 Subject: [PATCH] fix(gamescope): About UI Signed-off-by: Collecting --- src/citron/about_dialog.cpp | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/citron/about_dialog.cpp b/src/citron/about_dialog.cpp index 9b9d15019..7522b11a8 100644 --- a/src/citron/about_dialog.cpp +++ b/src/citron/about_dialog.cpp @@ -13,47 +13,41 @@ #include "citron/about_dialog.h" AboutDialog::AboutDialog(QWidget* parent) -: QDialog(parent) { + : QDialog(parent) { const bool is_gamescope = !qgetenv("GAMESCOPE_WIDTH").isEmpty() || qgetenv("XDG_CURRENT_DESKTOP") == "gamescope"; if (is_gamescope) { setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint); setWindowModality(Qt::NonModal); - } else { - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); } ui = std::make_unique(); ui->setupUi(this); connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); - connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); std::string citron_build_version = "citron | 0.12.25"; - #ifdef CITRON_ENABLE_PGO_USE +#ifdef CITRON_ENABLE_PGO_USE citron_build_version += " | PGO"; - #endif +#endif if (is_gamescope) { - // Safe-zone sizing for the Deck - resize(850, 500); + resize(700, 450); - // Add padding so text doesn't hit the edges of the screen - if (this->layout()) { - this->layout()->setContentsMargins(24, 24, 24, 24); - this->layout()->setSpacing(12); - } + // Scale fonts up slightly so they aren't "too small" + QFont font = this->font(); + font.setPointSize(font.pointSize() + 1); + this->setFont(font); - // Scale the "citron" title slightly for the handheld screen - // without stripping the HTML colors/fonts - QString currentStyle = ui->labelCitron->styleSheet(); - ui->labelCitron->setStyleSheet(currentStyle + QStringLiteral("font-size: 22pt;")); + // Keep the Citron header large + ui->labelCitron->setStyleSheet(QStringLiteral("font-size: 24pt; font-weight: bold;")); } const QIcon citron_logo = QIcon::fromTheme(QStringLiteral("org.citron_emu.citron")); if (!citron_logo.isNull()) { - int logo_size = is_gamescope ? 160 : 200; - ui->labelLogo->setPixmap(citron_logo.pixmap(logo_size)); + int logo_size = is_gamescope ? 150 : 200; + ui->labelLogo->setPixmap(citron_logo.pixmap(logo_size, logo_size)); + ui->labelLogo->setScaledContents(true); ui->labelLogo->setFixedSize(logo_size, logo_size); }