fix(overhaul): UI and resolution bugs for Steam Deck (Gamescope)

Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
Collecting
2026-01-04 02:17:36 +00:00
parent 709351a37d
commit 6779abad37

View File

@@ -126,8 +126,18 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st
linux_tab = std::make_unique<ConfigureLinuxTab>(system_, tab_group, *builder, this);
system_tab = std::make_unique<ConfigureSystem>(system_, tab_group, *builder, this);
if (!UISettings::values.per_game_configure_geometry.isEmpty()) {
restoreGeometry(UISettings::values.per_game_configure_geometry);
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);
resize(1100, 700);
} else {
setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
setWindowModality(Qt::WindowModal);
if (!UISettings::values.per_game_configure_geometry.isEmpty()) {
restoreGeometry(UISettings::values.per_game_configure_geometry);
}
}
UpdateTheme();
@@ -322,26 +332,25 @@ void ConfigurePerGame::UpdateTheme() {
if (ui->tabButtonsScrollArea) {
ui->tabButtonsScrollArea->setStyleSheet(QStringLiteral(
"QScrollBar:horizontal { height: 14px; background: transparent; border-radius: 7px; }"
"QScrollBar::handle:horizontal { background-color: %1; border-radius: 6px; min-width: 30px; margin: 1px; }"
"QScrollBar::handle:horizontal { background-color: %1; border-radius: 64px; min-width: 30px; margin: 1px; }"
"QScrollBar::add-line, QScrollBar::sub-line { background: none; width: 0px; }"
).arg(hue_hex));
}
// 3. Action Buttons (OK/Cancel) and Trim button
if (ui->buttonBox && !ui->buttonBox->underMouse()) {
ui->buttonBox->setStyleSheet(QStringLiteral(
"QPushButton { background-color: %1; color: #ffffff; border-radius: 4px; font-weight: bold; padding: 5px 15px; }"
"QPushButton:hover { background-color: %2; }"
"QPushButton:pressed { background-color: %3; }"
).arg(hue_hex).arg(hue_light).arg(hue_dark));
}
// 3. Action Buttons
const QString button_css = QStringLiteral(
"QPushButton { background-color: %1; color: #ffffff; border-radius: 4px; font-weight: bold; padding: 5px 15px; }"
"QPushButton:hover { background-color: %2; }"
"QPushButton:pressed { background-color: %3; }"
).arg(hue_hex).arg(hue_light).arg(hue_dark);
if (ui->trim_xci_button && !ui->trim_xci_button->underMouse()) {
ui->trim_xci_button->setStyleSheet(QStringLiteral(
"QPushButton { background-color: %1; color: #ffffff; border: none; border-radius: 4px; padding: 10px; }"
"QPushButton:hover { background-color: %2; }"
"QPushButton:pressed { background-color: %3; }"
).arg(hue_hex).arg(hue_light).arg(hue_dark));
if (ui->buttonBox) {
for (auto* button : ui->buttonBox->findChildren<QPushButton*>()) {
if (!button->isDown()) button->setStyleSheet(button_css);
}
}
if (ui->trim_xci_button && !ui->trim_xci_button->isDown()) {
ui->trim_xci_button->setStyleSheet(button_css);
}
// 4. Tab Content Area
@@ -374,7 +383,25 @@ void ConfigurePerGame::UpdateTheme() {
});
}
rainbow_timer->start(33);
} else if (rainbow_timer) {
}
// Fix for Gamescope: Style buttons once outside the timer loop
if (ui->buttonBox) {
ui->buttonBox->setStyleSheet(QStringLiteral(
"QPushButton { background-color: %1; color: #ffffff; border-radius: 4px; font-weight: bold; padding: 5px 15px; }"
"QPushButton:hover { background-color: %2; }"
"QPushButton:pressed { background-color: %3; }"
).arg(accent).arg(Theme::GetAccentColorHover()).arg(Theme::GetAccentColorPressed()));
}
if (ui->trim_xci_button) {
ui->trim_xci_button->setStyleSheet(QStringLiteral(
"QPushButton { background-color: %1; color: #ffffff; border: none; border-radius: 4px; padding: 10px; }"
"QPushButton:hover { background-color: %2; }"
"QPushButton:pressed { background-color: %3; }"
).arg(accent).arg(Theme::GetAccentColorHover()).arg(Theme::GetAccentColorPressed()));
}
if (UISettings::values.enable_rainbow_mode.GetValue() == false && rainbow_timer) {
rainbow_timer->stop();
if (ui->tabButtonsContainer) ui->tabButtonsContainer->setStyleSheet({});
if (ui->tabButtonsScrollArea) ui->tabButtonsScrollArea->setStyleSheet({});