diff options
| author | spaina93 <72979505+spaina93@users.noreply.github.com> | 2026-11-02 08:35:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-02 08:35:22 +0100 |
| commit | b7d654b9dcaf3e8f688c2c16e77737947b41a108 (patch) | |
| tree | a758abf4611adcaecfebd2c4ae89e1a20a681eaa /src/yuzu | |
| parent | 9c55e70d790a4cc9507d80dbb9a9d6224175574e (diff) | |
qt: save frame generation settings (#283)
Six frame generation settings are paired with frame_gen, so each widget
made its own checkbox and saved it to frame_gen on apply. The last one
won, so ticking only the first box left frame generation off.
Don't make a checkbox for a paired setting without the Paired
specialization. frame_gen is the only such setting, and it gets its own
widget again. Keep the pairing itself, Android uses it to hide the
options. On Qt, hide them while frame generation is off.
Fixes #251
Assisted-by: Claude Opus 5.5 (diagnosis, code and commit message)
Signed-off-by: spaina93 <72979505+spaina93@users.noreply.github.com>
Diffstat (limited to 'src/yuzu')
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 22 | ||||
| -rw-r--r-- | src/yuzu/configuration/shared_widget.cpp | 8 |
2 files changed, 26 insertions, 4 deletions
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index e4a140fff5..074b6f405b 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -218,6 +218,7 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) { std::map<u32, QWidget*> hold_graphics; std::vector<QWidget*> hold_api; + QCheckBox* frame_gen_checkbox = nullptr; for (const auto setting : Settings::values.linkage.by_category[Settings::Category::Renderer]) { #ifndef HAS_RESHADE @@ -225,9 +226,6 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) { continue; } #endif - if (setting->Id() == Settings::values.frame_gen.Id()) { - continue; - } ConfigurationShared::Widget* widget = [&]() { if (setting->Id() == Settings::values.fsr_sharpening_slider.Id()) { @@ -325,6 +323,9 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) { hold_graphics.emplace(setting->Id(), widget); #endif + } else if (setting->Id() == Settings::values.frame_gen.Id()) { + frame_gen_checkbox = widget->checkbox; + hold_graphics.emplace(setting->Id(), widget); } else { hold_graphics.emplace(setting->Id(), widget); } @@ -334,6 +335,21 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) { graphics_layout.addWidget(widget); } + // Hide rather than disable, a disabled widget would read as using the global value + if (frame_gen_checkbox != nullptr) { + for (const u32 id : {Settings::values.frame_gen_type.Id(), + Settings::values.frame_gen_multiplier.Id(), + Settings::values.frame_gen_target_rate.Id(), + Settings::values.frame_gen_flow_scale_auto.Id(), + Settings::values.frame_gen_flow_scale.Id(), + Settings::values.frame_gen_queue_target.Id()}) { + if (const auto it = hold_graphics.find(id); it != hold_graphics.end()) { + it->second->setVisible(frame_gen_checkbox->isChecked()); + connect(frame_gen_checkbox, &QCheckBox::toggled, it->second, &QWidget::setVisible); + } + } + } + for (auto widget : hold_api) { api_grid_layout->addWidget(widget); } diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp index 0e829e9100..4971c0cfa7 100644 --- a/src/yuzu/configuration/shared_widget.cpp +++ b/src/yuzu/configuration/shared_widget.cpp @@ -515,7 +515,13 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu layout->setContentsMargins(0, 0, 0, 0); if (other_setting == nullptr) { - other_setting = setting.PairedSetting(); + // A paired setting without the Paired specialization gets a widget of its own, and + // several settings can share it, so they must not each save their own checkbox to it + auto* const paired_setting = setting.PairedSetting(); + if (paired_setting != nullptr && + paired_setting->Specialization() == Settings::Specialization::Paired) { + other_setting = paired_setting; + } } const bool require_checkbox = other_setting != nullptr && other_setting->TypeId() == "bool"; |
