diff --git a/src/citron/configuration/configure.ui b/src/citron/configuration/configure.ui
index 7d1558662..406e450e4 100644
--- a/src/citron/configuration/configure.ui
+++ b/src/citron/configuration/configure.ui
@@ -270,11 +270,6 @@
background-color: transparent;
}
- QComboBox::down-arrow {
- width: 12px;
- height: 12px;
- background-color: #ffffff;
- }
QComboBox QAbstractItemView {
background-color: #3d3d3d;
@@ -512,8 +507,8 @@
height: 20px;
}
}
-
-
+
+
8
diff --git a/src/citron/configuration/configure_audio.cpp b/src/citron/configuration/configure_audio.cpp
index a58031179..d28f6a7bf 100644
--- a/src/citron/configuration/configure_audio.cpp
+++ b/src/citron/configuration/configure_audio.cpp
@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
+// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include
-
-
Info
@@ -278,7 +688,6 @@
-
-
diff --git a/src/citron/configuration/configure_system.cpp b/src/citron/configuration/configure_system.cpp
index 685772858..d50907fab 100644
--- a/src/citron/configuration/configure_system.cpp
+++ b/src/citron/configuration/configure_system.cpp
@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
+// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include
@@ -20,6 +21,7 @@
#include "citron/configuration/configuration_shared.h"
#include "citron/configuration/configure_system.h"
#include "citron/configuration/shared_widget.h"
+#include "citron/theme.h" // Added for Theme::GetAccentColor
constexpr std::array LOCALE_BLOCKLIST{
// pzzefezrpnkzeidfej
@@ -47,12 +49,12 @@ static bool IsValidLocale(u32 region_index, u32 language_index) {
ConfigureSystem::ConfigureSystem(Core::System& system_,
std::shared_ptr> group_,
const ConfigurationShared::Builder& builder, QWidget* parent)
- : Tab(group_, parent), ui{std::make_unique()}, system{system_} {
+: Tab(group_, parent), ui{std::make_unique()}, system{system_} {
ui->setupUi(this);
const auto posix_time = std::chrono::system_clock::now().time_since_epoch();
const auto current_time_s =
- std::chrono::duration_cast(posix_time).count();
+ std::chrono::duration_cast(posix_time).count();
previous_time = current_time_s + Settings::values.custom_rtc_offset.GetValue();
Setup(builder);
@@ -65,8 +67,8 @@ ConfigureSystem::ConfigureSystem(Core::System& system_,
if (!valid_locale) {
ui->label_warn_invalid_locale->setText(
tr("Warning: \"%1\" is not a valid language for region \"%2\"")
- .arg(combo_language->currentText())
- .arg(combo_region->currentText()));
+ .arg(combo_language->currentText())
+ .arg(combo_region->currentText()));
}
};
@@ -129,9 +131,9 @@ void ConfigureSystem::Setup(const ConfigurationShared::Builder& builder) {
if (setting->Id() == Settings::values.use_docked_mode.Id() &&
Settings::IsConfiguringGlobal()) {
continue;
- }
+ }
- ConfigurationShared::Widget* widget = builder.BuildWidget(setting, apply_funcs);
+ ConfigurationShared::Widget* widget = builder.BuildWidget(setting, apply_funcs);
if (widget == nullptr) {
continue;
@@ -164,14 +166,14 @@ void ConfigureSystem::Setup(const ConfigurationShared::Builder& builder) {
}
switch (setting->GetCategory()) {
- case Settings::Category::Core:
- core_hold.emplace(setting->Id(), widget);
- break;
- case Settings::Category::System:
- system_hold.emplace(setting->Id(), widget);
- break;
- default:
- widget->deleteLater();
+ case Settings::Category::Core:
+ core_hold.emplace(setting->Id(), widget);
+ break;
+ case Settings::Category::System:
+ system_hold.emplace(setting->Id(), widget);
+ break;
+ default:
+ widget->deleteLater();
}
}
for (const auto& [label, widget] : core_hold) {
@@ -204,3 +206,32 @@ void ConfigureSystem::ApplyConfiguration() {
}
UpdateRtcTime();
}
+
+QString ConfigureSystem::GetTemplateStyleSheet() const {
+ return m_template_style_sheet;
+}
+
+void ConfigureSystem::SetTemplateStyleSheet(const QString& sheet) {
+ if (m_template_style_sheet == sheet) {
+ return;
+ }
+
+ m_template_style_sheet = sheet;
+
+ // Get the current accent color from the theme manager
+ const QColor accent_color(Theme::GetAccentColor());
+ const QColor accent_color_hover = accent_color.lighter(115);
+ const QColor accent_color_pressed = accent_color.darker(115);
+
+ QString final_style = m_template_style_sheet;
+
+ // Replace all placeholders with the actual color values
+ final_style.replace(QStringLiteral("%%ACCENT_COLOR%%"), accent_color.name(QColor::HexRgb));
+ final_style.replace(QStringLiteral("%%ACCENT_COLOR_HOVER%%"), accent_color_hover.name(QColor::HexRgb));
+ final_style.replace(QStringLiteral("%%ACCENT_COLOR_PRESSED%%"), accent_color_pressed.name(QColor::HexRgb));
+
+ // Apply the finished stylesheet to THIS widget and all its children
+ this->setStyleSheet(final_style);
+
+ emit TemplateStyleSheetChanged();
+}
diff --git a/src/citron/configuration/configure_system.h b/src/citron/configuration/configure_system.h
index a1a3a799d..e795a9d1b 100644
--- a/src/citron/configuration/configure_system.h
+++ b/src/citron/configuration/configure_system.h
@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
+// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@@ -7,6 +8,7 @@
#include
#include
+#include // Added for stylesheet property
#include
#include "citron/configuration/configuration_shared.h"
@@ -15,20 +17,23 @@ class QLineEdit;
class QComboBox;
class QDateTimeEdit;
namespace Core {
-class System;
+ class System;
}
namespace Ui {
-class ConfigureSystem;
+ class ConfigureSystem;
}
namespace ConfigurationShared {
-class Builder;
+ class Builder;
}
class ConfigureSystem : public ConfigurationShared::Tab {
Q_OBJECT
+ // This property allows the main UI file to pass its stylesheet to this widget
+ Q_PROPERTY(QString templateStyleSheet READ GetTemplateStyleSheet WRITE SetTemplateStyleSheet NOTIFY TemplateStyleSheetChanged)
+
public:
explicit ConfigureSystem(Core::System& system_,
std::shared_ptr> group,
@@ -39,6 +44,13 @@ public:
void ApplyConfiguration() override;
void SetConfiguration() override;
+ // These functions get and set the stylesheet property
+ QString GetTemplateStyleSheet() const;
+ void SetTemplateStyleSheet(const QString& sheet);
+
+signals:
+ void TemplateStyleSheetChanged();
+
private:
void changeEvent(QEvent* event) override;
void RetranslateUI();
@@ -60,4 +72,7 @@ private:
QDateTimeEdit* date_rtc;
QSpinBox* date_rtc_offset;
u64 previous_time;
+
+ // This variable will hold the raw stylesheet string
+ QString m_template_style_sheet;
};