diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/configuration/configuration_shared.cpp | 4 | ||||
-rw-r--r-- | src/yuzu/configuration/configuration_shared.h | 2 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 38 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.cpp | 6 |
4 files changed, 28 insertions, 22 deletions
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp index 28b655222..a648d339b 100644 --- a/src/yuzu/configuration/configuration_shared.cpp +++ b/src/yuzu/configuration/configuration_shared.cpp @@ -125,8 +125,8 @@ void ConfigurationShared::InsertGlobalItem(QComboBox* combobox) { combobox->insertSeparator(ConfigurationShared::USE_GLOBAL_SEPARATOR_INDEX); } -void ConfigurationShared::InsertGlobalItem(QComboBox* combobox, const QString& global) { - const QString use_global_text = ConfigurePerGame::tr("Use global configuration (%1)").arg(global); +void ConfigurationShared::InsertGlobalItem(QComboBox* combobox, int global_index) { + const QString use_global_text = ConfigurePerGame::tr("Use global configuration (%1)").arg(combobox->itemText(global_index)); combobox->insertItem(ConfigurationShared::USE_GLOBAL_INDEX, use_global_text); combobox->insertSeparator(ConfigurationShared::USE_GLOBAL_SEPARATOR_INDEX); } diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index 71011fd92..f3676bd3a 100644 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h @@ -61,6 +61,6 @@ void SetColoredTristate(QCheckBox* checkbox, const std::string& name, const Sett ConfigurationShared::CheckState& tracker); void InsertGlobalItem(QComboBox* combobox); -void InsertGlobalItem(QComboBox* combobox, const QString& global); +void InsertGlobalItem(QComboBox* combobox, int global_index); } // namespace ConfigurationShared diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 07dc75ccb..c1b38728d 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -31,13 +31,14 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) SetConfiguration(); - connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, - [this] { - UpdateDeviceComboBox(); - if (!Settings::configuring_global) { - ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", ui->api->currentIndex() != ConfigurationShared::USE_GLOBAL_INDEX); - } - }); + connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, [this] { + UpdateDeviceComboBox(); + if (!Settings::configuring_global) { + ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", + ui->api->currentIndex() != + ConfigurationShared::USE_GLOBAL_INDEX); + } + }); connect(ui->device, qOverload<int>(&QComboBox::activated), this, [this](int device) { UpdateDeviceSelection(device); }); @@ -84,9 +85,12 @@ void ConfigureGraphics::SetConfiguration() { ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); - ConfigurationShared::SetHighlight(ui->aspect_ratio_layout, "aspect_ratio_layout", !Settings::values.aspect_ratio.UsingGlobal()); - ConfigurationShared::SetHighlight(ui->bg_layout, "bg_layout", !Settings::values.bg_red.UsingGlobal()); - // FIXME: ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", !Settings::values.renderer_backend.UsingGlobal()); + ConfigurationShared::SetHighlight(ui->aspect_ratio_layout, "aspect_ratio_layout", + !Settings::values.aspect_ratio.UsingGlobal()); + ConfigurationShared::SetHighlight(ui->bg_layout, "bg_layout", + !Settings::values.bg_red.UsingGlobal()); + // FIXME: ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", + // !Settings::values.renderer_backend.UsingGlobal()); } UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red.GetValue(), @@ -243,9 +247,11 @@ void ConfigureGraphics::SetupPerGameUI() { return; } - connect(ui->aspect_ratio_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, [this](int index) { - ConfigurationShared::SetHighlight(ui->aspect_ratio_layout, "aspect_ratio_layout", index != 0); - }); + connect(ui->aspect_ratio_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), + this, [this](int index) { + ConfigurationShared::SetHighlight(ui->aspect_ratio_layout, "aspect_ratio_layout", + index != 0); + }); connect(ui->bg_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, [this](int index) { ui->bg_button->setEnabled(index == 1); @@ -260,6 +266,8 @@ void ConfigureGraphics::SetupPerGameUI() { Settings::values.use_asynchronous_gpu_emulation, ConfigurationShared::trackers.use_asynchronous_gpu_emulation); - ConfigurationShared::InsertGlobalItem(ui->aspect_ratio_combobox, ui->aspect_ratio_combobox->itemText(Settings::values.aspect_ratio.GetValue(true))); - ConfigurationShared::InsertGlobalItem(ui->api, ui->api->itemText(static_cast<int>(Settings::values.renderer_backend.GetValue(true)))); + ConfigurationShared::InsertGlobalItem(ui->aspect_ratio_combobox, + Settings::values.aspect_ratio.GetValue(true)); + ConfigurationShared::InsertGlobalItem( + ui->api, static_cast<int>(Settings::values.renderer_backend.GetValue(true))); } diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index fbeaeccbc..1d9a1076e 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp @@ -157,12 +157,10 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() { Settings::values.force_30fps_mode, ConfigurationShared::trackers.force_30fps_mode); ConfigurationShared::InsertGlobalItem( - ui->gpu_accuracy, - ui->gpu_accuracy->itemText(static_cast<int>(Settings::values.gpu_accuracy.GetValue(true)))); + ui->gpu_accuracy, static_cast<int>(Settings::values.gpu_accuracy.GetValue(true))); ConfigurationShared::InsertGlobalItem( ui->anisotropic_filtering_combobox, - ui->anisotropic_filtering_combobox->itemText( - static_cast<int>(Settings::values.max_anisotropy.GetValue(true)))); + static_cast<int>(Settings::values.max_anisotropy.GetValue(true))); connect(ui->gpu_accuracy, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, [this](int index) { |