diff --git a/src/citron/configuration/configure.ui b/src/citron/configuration/configure.ui index d21be9c5e..3c6daf674 100644 --- a/src/citron/configuration/configure.ui +++ b/src/citron/configuration/configure.ui @@ -69,8 +69,6 @@ border-left: 2px solid %%ACCENT_COLOR%%; } - /* All other styles remain the same... just paste this block at the top */ - QWidget { background-color: %%BACKGROUND_COLOR%%; color: %%TEXT_COLOR%%; @@ -217,18 +215,31 @@ selection-background-color: %%ACCENT_COLOR%%; } - QPushButton { - background-color: %%ACCENT_COLOR%%; - color: #ffffff; - border: none; - padding: 10px 20px; + QPushButton, QToolButton { + background-color: transparent; + color: %%TEXT_COLOR%%; + border: 2px solid %%ACCENT_COLOR%%; + padding: 5px 15px; border-radius: 6px; font-weight: bold; min-height: 20px; } - QPushButton:hover { - background-color: %%ACCENT_COLOR_HOVER%%; + QPushButton:hover, QToolButton:hover { + color: %%ACCENT_COLOR_HOVER%%; + border-color: %%ACCENT_COLOR_HOVER%%; + } + + QPushButton:pressed, QToolButton:pressed { + color: #ffffff; + background-color: %%ACCENT_COLOR_PRESSED%%; + border-color: %%ACCENT_COLOR_PRESSED%%; + } + + QPushButton:disabled, QToolButton:disabled { + background-color: %%TERTIARY_BG_COLOR%%; + border-color: %%TERTIARY_BG_COLOR%%; + color: %%DISABLED_TEXT_COLOR%%; } diff --git a/src/citron/configuration/configure_dialog.cpp b/src/citron/configuration/configure_dialog.cpp index ebe40ca9c..a37ad9199 100644 --- a/src/citron/configuration/configure_dialog.cpp +++ b/src/citron/configuration/configure_dialog.cpp @@ -247,11 +247,24 @@ void ConfigureDialog::UpdateTheme() { cpu_tab->SetTemplateStyleSheet(style_sheet); graphics_advanced_tab->SetTemplateStyleSheet(style_sheet); + QString sidebar_css = QStringLiteral( + "QPushButton.tabButton { background-color: %1; color: %2; border: 2px solid transparent; }" + "QPushButton.tabButton:checked { color: %3; border: 2px solid %3; }" + "QPushButton.tabButton:hover { border: 2px solid %3; }" + "QPushButton.tabButton:pressed { background-color: %3; color: #ffffff; }" + ).arg(b_bg).arg(d_txt).arg(accent); + + if (ui->topButtonWidget) ui->topButtonWidget->setStyleSheet(sidebar_css); + if (ui->horizontalNavWidget) ui->horizontalNavWidget->setStyleSheet(sidebar_css); + if (is_rainbow) { if (!rainbow_timer) { rainbow_timer = new QTimer(this); - connect(rainbow_timer, &QTimer::timeout, this, [this] { - if (m_is_tab_animating || !this->isVisible() || !this->isActiveWindow()) return; + connect(rainbow_timer, &QTimer::timeout, this, [this, b_bg, d_txt, txt] { + // Don't update during animation to prevent lag + if (ui->buttonBox->underMouse() || m_is_tab_animating || !this->isVisible() || !this->isActiveWindow()) { + return; + } const int current_index = ui->stackedWidget->currentIndex(); const int input_tab_index = 7; @@ -261,84 +274,45 @@ void ConfigureDialog::UpdateTheme() { const QString hue_light = current_color.lighter(125).name(); const QString hue_dark = current_color.darker(150).name(); - // 1. Sidebar Tabs - QString sidebar_css = QStringLiteral( - "QPushButton.tabButton { border: 2px solid transparent; }" - "QPushButton.tabButton:checked { color: %1; border: 2px solid %1; }" - "QPushButton.tabButton:hover { border: 2px solid %1; }" - "QPushButton.tabButton:pressed { background-color: %1; color: #ffffff; }" - ).arg(hue_hex); - if (ui->topButtonWidget) ui->topButtonWidget->setStyleSheet(sidebar_css); - if (ui->horizontalNavWidget) ui->horizontalNavWidget->setStyleSheet(sidebar_css); + // Update sidebar with rainbow colors + QString rainbow_sidebar_css = QStringLiteral( + "QPushButton.tabButton { background-color: %1; color: %2; border: 2px solid transparent; }" + "QPushButton.tabButton:checked { color: %3; border: 2px solid %3; }" + "QPushButton.tabButton:hover { border: 2px solid %3; }" + "QPushButton.tabButton:pressed { background-color: %3; color: #ffffff; }" + ).arg(b_bg).arg(d_txt).arg(hue_hex); + if (ui->topButtonWidget) ui->topButtonWidget->setStyleSheet(rainbow_sidebar_css); + if (ui->horizontalNavWidget) ui->horizontalNavWidget->setStyleSheet(rainbow_sidebar_css); - // 2. Action Buttons (OK/Apply/Cancel) - if (ui->buttonBox) { - 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); - - for (auto* button : ui->buttonBox->findChildren()) { - if (!button->isDown()) { - button->setStyleSheet(button_css); - } - } - } - - // 3. Tab Content Area + // Tab Content Area if (current_index == input_tab_index) return; QWidget* currentContainer = ui->stackedWidget->currentWidget(); if (currentContainer) { - QWidget* actualTab = currentContainer; - if (auto* scroll = qobject_cast(currentContainer)) { - actualTab = scroll->widget(); - } - - if (actualTab) { - QString tab_css = QStringLiteral( - "QCheckBox::indicator:checked, QRadioButton::indicator:checked { background-color: %1; border: 1px solid %1; }" - "QSlider::handle:horizontal { background-color: %1; border: 1px solid %1; border-radius: 7px; }" - "QScrollBar::handle:vertical, QScrollBar::handle:horizontal { background-color: %1; border-radius: 4px; min-height: 20px; }" - "QScrollBar:vertical, QScrollBar:horizontal { background: transparent; }" - "QComboBox { border: 1px solid %1; selection-background-color: %1; }" - "QComboBox QAbstractItemView { border: 2px solid %1; selection-background-color: %1; background-color: #2b2b2b; }" - "QComboBox QAbstractItemView::item:selected { background-color: %1; color: #ffffff; }" - "QPushButton, QToolButton { background-color: %1; color: #ffffff; border: none; border-radius: 4px; padding: 5px; }" - "QPushButton:hover, QToolButton:hover { background-color: %2; }" - "QPushButton:pressed, QToolButton:pressed { background-color: %3; }" - "QPushButton#aestheticTabButton { background-color: transparent; border: 2px solid %1; }" - "QPushButton#aestheticTabButton:checked { background-color: %1; }" - ).arg(hue_hex).arg(hue_light).arg(hue_dark); - - currentContainer->setStyleSheet(tab_css); - actualTab->setStyleSheet(tab_css); - } + QString tab_css = QStringLiteral( + "QCheckBox::indicator:checked, QRadioButton::indicator:checked { background-color: %1; border: 1px solid %1; }" + "QSlider::sub-page:horizontal { background: %1; border-radius: 4px; }" + "QSlider::handle:horizontal { background-color: %1; border: 1px solid %1; width: 18px; height: 18px; margin: -5px 0; border-radius: 9px; }" + "QPushButton, QToolButton { background-color: transparent; color: %4; border: 2px solid %1; border-radius: 4px; padding: 5px; }" + "QPushButton:hover, QToolButton:hover { border-color: %2; color: %2; }" + "QPushButton:pressed, QToolButton:pressed { background-color: %3; color: #ffffff; border-color: %3; }" + ).arg(hue_hex).arg(hue_light).arg(hue_dark).arg(txt); + currentContainer->setStyleSheet(tab_css); + if (ui->buttonBox) ui->buttonBox->setStyleSheet(tab_css); } }); } rainbow_timer->start(33); } - 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 (UISettings::values.enable_rainbow_mode.GetValue() == false && rainbow_timer) { rainbow_timer->stop(); - if (ui->topButtonWidget) ui->topButtonWidget->setStyleSheet({}); - if (ui->horizontalNavWidget) ui->horizontalNavWidget->setStyleSheet({}); + + // Just reset the content areas if (ui->buttonBox) ui->buttonBox->setStyleSheet({}); for (int i = 0; i < ui->stackedWidget->count(); ++i) { - QWidget* w = ui->stackedWidget->widget(i); - if (w) w->setStyleSheet({}); - if (auto* s = qobject_cast(w)) { - if (s->widget()) s->widget()->setStyleSheet({}); + if (auto* w = ui->stackedWidget->widget(i)) { + w->setStyleSheet({}); } } } diff --git a/src/citron/configuration/configure_input.ui b/src/citron/configuration/configure_input.ui index d51774028..6d78495cd 100644 --- a/src/citron/configuration/configure_input.ui +++ b/src/citron/configuration/configure_input.ui @@ -196,21 +196,6 @@ - - - 68 - 0 - - - - - 68 - 16777215 - - - - min-width: 68px; - Configure @@ -242,21 +227,6 @@ - - - 68 - 0 - - - - - 68 - 16777215 - - - - min-width: 68px; - Configure @@ -460,36 +430,6 @@ 0 - - - 68 - 0 - - - - - 68 - 16777215 - - - - - 0 - 0 - - - - - 0 - 0 - - - - Qt::LeftToRight - - - min-width: 68px; - Defaults @@ -503,36 +443,6 @@ 0 - - - 68 - 0 - - - - - 68 - 16777215 - - - - - 0 - 0 - - - - - 0 - 0 - - - - Qt::LeftToRight - - - min-width: 68px; - Clear diff --git a/src/citron/configuration/configure_per_game.cpp b/src/citron/configuration/configure_per_game.cpp index 25da8e0b5..fc76fe3ae 100644 --- a/src/citron/configuration/configure_per_game.cpp +++ b/src/citron/configuration/configure_per_game.cpp @@ -332,7 +332,7 @@ void ConfigurePerGame::UpdateTheme() { if (is_rainbow) { if (!rainbow_timer) { rainbow_timer = new QTimer(this); - connect(rainbow_timer, &QTimer::timeout, this, [this] { + connect(rainbow_timer, &QTimer::timeout, this, [this, txt] { if (m_is_tab_animating || !this->isVisible() || !this->isActiveWindow()) return; const QColor current_color = RainbowStyle::GetCurrentHighlightColor(); @@ -360,9 +360,9 @@ void ConfigurePerGame::UpdateTheme() { // 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; }" + "QPushButton { background-color: transparent; color: #ffffff; border: 2px solid %1; border-radius: 4px; font-weight: bold; padding: 4px 12px; }" + "QPushButton:hover { border-color: %2; color: %2; }" + "QPushButton:pressed { background-color: %3; color: #ffffff; border-color: %3; }" ).arg(hue_hex).arg(hue_light).arg(hue_dark); if (ui->buttonBox) { @@ -373,6 +373,12 @@ void ConfigurePerGame::UpdateTheme() { if (ui->trim_xci_button && !ui->trim_xci_button->isDown()) { ui->trim_xci_button->setStyleSheet(button_css); } + if (auto* share_btn = findChild(QStringLiteral("share_settings_button"))) { + if (!share_btn->isDown()) share_btn->setStyleSheet(button_css); + } + if (auto* use_btn = findChild(QStringLiteral("use_settings_button"))) { + if (!use_btn->isDown()) use_btn->setStyleSheet(button_css); + } // 4. Tab Content Area QWidget* currentContainer = ui->stackedWidget->currentWidget(); @@ -392,9 +398,9 @@ void ConfigurePerGame::UpdateTheme() { "QComboBox QAbstractItemView::item:selected { background-color: %1; color: #ffffff; }" "QScrollBar::handle:vertical, QScrollBar::handle:horizontal { background-color: %1; border-radius: 7px; }" "QScrollBar:vertical, QScrollBar:horizontal { background: transparent; }" - "QPushButton, QToolButton { background-color: %1; color: #ffffff; border: none; border-radius: 4px; padding: 5px; }" - "QPushButton:hover, QToolButton:hover { background-color: %2; }" - "QPushButton:pressed, QToolButton:pressed { background-color: %3; }" + "QPushButton, QToolButton { background-color: transparent; color: #ffffff; border: 2px solid %1; border-radius: 4px; padding: 5px; }" + "QPushButton:hover, QToolButton:hover { border-color: %2; color: %2; }" + "QPushButton:pressed, QToolButton:pressed { background-color: %3; color: #ffffff; border-color: %3; }" ).arg(hue_hex).arg(hue_light).arg(hue_dark); currentContainer->setStyleSheet(content_css); @@ -404,21 +410,21 @@ void ConfigurePerGame::UpdateTheme() { }); } rainbow_timer->start(33); - } + } // 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; }" + "QPushButton { background-color: transparent; color: #ffffff; border: 2px solid %1; border-radius: 4px; font-weight: bold; padding: 4px 12px; }" + "QPushButton:hover { border-color: %2; color: %2; }" + "QPushButton:pressed { background-color: %3; color: #ffffff; border-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; }" + "QPushButton { background-color: transparent; color: #ffffff; border: 2px solid %1; border-radius: 4px; font-weight: bold; padding: 4px 12px; }" + "QPushButton:hover { border-color: %2; color: %2; }" + "QPushButton:pressed { background-color: %3; color: #ffffff; border-color: %3; }" ).arg(accent).arg(Theme::GetAccentColorHover()).arg(Theme::GetAccentColorPressed())); } diff --git a/src/citron/configuration/configure_per_game.ui b/src/citron/configuration/configure_per_game.ui index ac2dfd708..bed54d69a 100644 --- a/src/citron/configuration/configure_per_game.ui +++ b/src/citron/configuration/configure_per_game.ui @@ -235,46 +235,31 @@ background-color: %%FOCUS_BG_COLOR%%; } - QPushButton { - background-color: %%ACCENT_COLOR%%; - color: #ffffff; - border: none; - padding: 10px 20px; + QPushButton, QToolButton { + background-color: transparent; + color: %%TEXT_COLOR%%; + border: 2px solid %%ACCENT_COLOR%%; + padding: 5px 15px; border-radius: 6px; font-weight: bold; min-height: 20px; } - QPushButton:hover { - background-color: %%ACCENT_COLOR_HOVER%%; + QPushButton:hover, QToolButton:hover { + color: %%ACCENT_COLOR_HOVER%%; + border-color: %%ACCENT_COLOR_HOVER%%; } - QPushButton:pressed { - background-color: %%ACCENT_COLOR_PRESSED%%; - } - - QPushButton:disabled { - background-color: %%TERTIARY_BG_COLOR%%; - color: %%DISABLED_TEXT_COLOR%%; - } - - QToolButton { - background-color: %%ACCENT_COLOR%%; + QPushButton:pressed, QToolButton:pressed { color: #ffffff; - border: none; - padding: 8px 12px; - border-radius: 6px; - font-weight: bold; - min-width: 32px; - min-height: 24px; - } - - QToolButton:hover { - background-color: %%ACCENT_COLOR_HOVER%%; - } - - QToolButton:pressed { background-color: %%ACCENT_COLOR_PRESSED%%; + border-color: %%ACCENT_COLOR_PRESSED%%; + } + + QPushButton:disabled, QToolButton:disabled { + background-color: %%TERTIARY_BG_COLOR%%; + border-color: %%TERTIARY_BG_COLOR%%; + color: %%DISABLED_TEXT_COLOR%%; } QLabel { @@ -399,13 +384,13 @@ 0 0 318 - 836 + 786 0 - 836 + 786