diff options
| author | 2020-08-14 14:02:37 -0400 | |
|---|---|---|
| committer | 2020-08-14 14:17:02 -0400 | |
| commit | fe861098778c325264bf015488fd960d5f33c6d6 (patch) | |
| tree | a6cd86f4b79299895abde4eca2cc9e8f3060d55a | |
| parent | Merge pull request #4529 from lioncash/assignment (diff) | |
| download | yuzu-fe861098778c325264bf015488fd960d5f33c6d6.tar.gz yuzu-fe861098778c325264bf015488fd960d5f33c6d6.tar.xz yuzu-fe861098778c325264bf015488fd960d5f33c6d6.zip | |
configuration_shared: Simplify name lookup in highlighting functions
We can query the given object name directly from the widget itself. This
removes any potential for forgetting to change the name if the widget
gets renamed and makes the API much simpler (just pass in the widget,
and not worry about its name).
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/configuration/configuration_shared.cpp | 60 | ||||
| -rw-r--r-- | src/yuzu/configuration/configuration_shared.h | 13 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_audio.cpp | 13 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 32 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.cpp | 22 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 18 |
7 files changed, 74 insertions, 90 deletions
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp index f9becab6e..18482795c 100644 --- a/src/yuzu/configuration/configuration_shared.cpp +++ b/src/yuzu/configuration/configuration_shared.cpp | |||
| @@ -72,18 +72,18 @@ void ConfigurationShared::SetPerGameSetting( | |||
| 72 | ConfigurationShared::USE_GLOBAL_OFFSET); | 72 | ConfigurationShared::USE_GLOBAL_OFFSET); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | void ConfigurationShared::SetHighlight(QWidget* widget, const std::string& name, bool highlighted) { | 75 | void ConfigurationShared::SetHighlight(QWidget* widget, bool highlighted) { |
| 76 | if (highlighted) { | 76 | if (highlighted) { |
| 77 | widget->setStyleSheet(QStringLiteral("QWidget#%1 { background-color:rgba(0,203,255,0.5) }") | 77 | widget->setStyleSheet(QStringLiteral("QWidget#%1 { background-color:rgba(0,203,255,0.5) }") |
| 78 | .arg(QString::fromStdString(name))); | 78 | .arg(widget->objectName())); |
| 79 | } else { | 79 | } else { |
| 80 | widget->setStyleSheet(QStringLiteral("QWidget#%1 { background-color:rgba(0,0,0,0) }") | 80 | widget->setStyleSheet(QStringLiteral("QWidget#%1 { background-color:rgba(0,0,0,0) }") |
| 81 | .arg(QString::fromStdString(name))); | 81 | .arg(widget->objectName())); |
| 82 | } | 82 | } |
| 83 | widget->show(); | 83 | widget->show(); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | void ConfigurationShared::SetColoredTristate(QCheckBox* checkbox, const std::string& name, | 86 | void ConfigurationShared::SetColoredTristate(QCheckBox* checkbox, |
| 87 | const Settings::Setting<bool>& setting, | 87 | const Settings::Setting<bool>& setting, |
| 88 | CheckState& tracker) { | 88 | CheckState& tracker) { |
| 89 | if (setting.UsingGlobal()) { | 89 | if (setting.UsingGlobal()) { |
| @@ -91,45 +91,39 @@ void ConfigurationShared::SetColoredTristate(QCheckBox* checkbox, const std::str | |||
| 91 | } else { | 91 | } else { |
| 92 | tracker = (setting.GetValue() == setting.GetValue(true)) ? CheckState::On : CheckState::Off; | 92 | tracker = (setting.GetValue() == setting.GetValue(true)) ? CheckState::On : CheckState::Off; |
| 93 | } | 93 | } |
| 94 | SetHighlight(checkbox, name, tracker != CheckState::Global); | 94 | SetHighlight(checkbox, tracker != CheckState::Global); |
| 95 | QObject::connect(checkbox, &QCheckBox::clicked, checkbox, | 95 | QObject::connect(checkbox, &QCheckBox::clicked, checkbox, [checkbox, setting, &tracker] { |
| 96 | [checkbox, name, setting, &tracker]() { | 96 | tracker = static_cast<CheckState>((static_cast<int>(tracker) + 1) % |
| 97 | tracker = static_cast<CheckState>((static_cast<int>(tracker) + 1) % | 97 | static_cast<int>(CheckState::Count)); |
| 98 | static_cast<int>(CheckState::Count)); | 98 | if (tracker == CheckState::Global) { |
| 99 | if (tracker == CheckState::Global) { | 99 | checkbox->setChecked(setting.GetValue(true)); |
| 100 | checkbox->setChecked(setting.GetValue(true)); | 100 | } |
| 101 | } | 101 | SetHighlight(checkbox, tracker != CheckState::Global); |
| 102 | SetHighlight(checkbox, name, tracker != CheckState::Global); | 102 | }); |
| 103 | }); | ||
| 104 | } | 103 | } |
| 105 | 104 | ||
| 106 | void ConfigurationShared::SetColoredTristate(QCheckBox* checkbox, const std::string& name, | 105 | void ConfigurationShared::SetColoredTristate(QCheckBox* checkbox, bool global, bool state, |
| 107 | bool global, bool state, bool global_state, | 106 | bool global_state, CheckState& tracker) { |
| 108 | CheckState& tracker) { | ||
| 109 | if (global) { | 107 | if (global) { |
| 110 | tracker = CheckState::Global; | 108 | tracker = CheckState::Global; |
| 111 | } else { | 109 | } else { |
| 112 | tracker = (state == global_state) ? CheckState::On : CheckState::Off; | 110 | tracker = (state == global_state) ? CheckState::On : CheckState::Off; |
| 113 | } | 111 | } |
| 114 | SetHighlight(checkbox, name, tracker != CheckState::Global); | 112 | SetHighlight(checkbox, tracker != CheckState::Global); |
| 115 | QObject::connect(checkbox, &QCheckBox::clicked, checkbox, | 113 | QObject::connect(checkbox, &QCheckBox::clicked, checkbox, [checkbox, global_state, &tracker] { |
| 116 | [checkbox, name, global_state, &tracker]() { | 114 | tracker = static_cast<CheckState>((static_cast<int>(tracker) + 1) % |
| 117 | tracker = static_cast<CheckState>((static_cast<int>(tracker) + 1) % | 115 | static_cast<int>(CheckState::Count)); |
| 118 | static_cast<int>(CheckState::Count)); | 116 | if (tracker == CheckState::Global) { |
| 119 | if (tracker == CheckState::Global) { | 117 | checkbox->setChecked(global_state); |
| 120 | checkbox->setChecked(global_state); | 118 | } |
| 121 | } | 119 | SetHighlight(checkbox, tracker != CheckState::Global); |
| 122 | SetHighlight(checkbox, name, tracker != CheckState::Global); | 120 | }); |
| 123 | }); | ||
| 124 | } | 121 | } |
| 125 | 122 | ||
| 126 | void ConfigurationShared::SetColoredComboBox(QComboBox* combobox, QWidget* target, | 123 | void ConfigurationShared::SetColoredComboBox(QComboBox* combobox, QWidget* target, int global) { |
| 127 | const std::string& target_name, int global) { | ||
| 128 | InsertGlobalItem(combobox, global); | 124 | InsertGlobalItem(combobox, global); |
| 129 | QObject::connect(combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), target, | 125 | QObject::connect(combobox, qOverload<int>(&QComboBox::activated), target, |
| 130 | [target, target_name](int index) { | 126 | [target](int index) { SetHighlight(target, index != 0); }); |
| 131 | ConfigurationShared::SetHighlight(target, target_name, index != 0); | ||
| 132 | }); | ||
| 133 | } | 127 | } |
| 134 | 128 | ||
| 135 | void ConfigurationShared::InsertGlobalItem(QComboBox* combobox, int global_index) { | 129 | void ConfigurationShared::InsertGlobalItem(QComboBox* combobox, int global_index) { |
diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index 003148c68..312b9e549 100644 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h | |||
| @@ -39,13 +39,12 @@ void SetPerGameSetting(QComboBox* combobox, | |||
| 39 | void SetPerGameSetting(QComboBox* combobox, | 39 | void SetPerGameSetting(QComboBox* combobox, |
| 40 | const Settings::Setting<Settings::GPUAccuracy>* setting); | 40 | const Settings::Setting<Settings::GPUAccuracy>* setting); |
| 41 | 41 | ||
| 42 | void SetHighlight(QWidget* widget, const std::string& name, bool highlighted); | 42 | void SetHighlight(QWidget* widget, bool highlighted); |
| 43 | void SetColoredTristate(QCheckBox* checkbox, const std::string& name, | 43 | void SetColoredTristate(QCheckBox* checkbox, const Settings::Setting<bool>& setting, |
| 44 | const Settings::Setting<bool>& setting, CheckState& tracker); | 44 | CheckState& tracker); |
| 45 | void SetColoredTristate(QCheckBox* checkbox, const std::string& name, bool global, bool state, | 45 | void SetColoredTristate(QCheckBox* checkbox, bool global, bool state, bool global_state, |
| 46 | bool global_state, CheckState& tracker); | 46 | CheckState& tracker); |
| 47 | void SetColoredComboBox(QComboBox* combobox, QWidget* target, const std::string& target_name, | 47 | void SetColoredComboBox(QComboBox* combobox, QWidget* target, int global); |
| 48 | int global); | ||
| 49 | 48 | ||
| 50 | void InsertGlobalItem(QComboBox* combobox, int global_index); | 49 | void InsertGlobalItem(QComboBox* combobox, int global_index); |
| 51 | 50 | ||
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index fea632531..fa9124ecf 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp | |||
| @@ -59,7 +59,7 @@ void ConfigureAudio::SetConfiguration() { | |||
| 59 | ui->volume_combo_box->setCurrentIndex(1); | 59 | ui->volume_combo_box->setCurrentIndex(1); |
| 60 | ui->volume_slider->setEnabled(true); | 60 | ui->volume_slider->setEnabled(true); |
| 61 | } | 61 | } |
| 62 | ConfigurationShared::SetHighlight(ui->volume_layout, "volume_layout", | 62 | ConfigurationShared::SetHighlight(ui->volume_layout, |
| 63 | !Settings::values.volume.UsingGlobal()); | 63 | !Settings::values.volume.UsingGlobal()); |
| 64 | } | 64 | } |
| 65 | SetVolumeIndicatorText(ui->volume_slider->sliderPosition()); | 65 | SetVolumeIndicatorText(ui->volume_slider->sliderPosition()); |
| @@ -173,14 +173,13 @@ void ConfigureAudio::SetupPerGameUI() { | |||
| 173 | return; | 173 | return; |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | ConfigurationShared::SetColoredTristate(ui->toggle_audio_stretching, "toggle_audio_stretching", | 176 | ConfigurationShared::SetColoredTristate(ui->toggle_audio_stretching, |
| 177 | Settings::values.enable_audio_stretching, | 177 | Settings::values.enable_audio_stretching, |
| 178 | enable_audio_stretching); | 178 | enable_audio_stretching); |
| 179 | connect(ui->volume_combo_box, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), | 179 | connect(ui->volume_combo_box, qOverload<int>(&QComboBox::activated), this, [this](int index) { |
| 180 | this, [this](int index) { | 180 | ui->volume_slider->setEnabled(index == 1); |
| 181 | ui->volume_slider->setEnabled(index == 1); | 181 | ConfigurationShared::SetHighlight(ui->volume_layout, index == 1); |
| 182 | ConfigurationShared::SetHighlight(ui->volume_layout, "volume_layout", index == 1); | 182 | }); |
| 183 | }); | ||
| 184 | 183 | ||
| 185 | ui->output_sink_combo_box->setVisible(false); | 184 | ui->output_sink_combo_box->setVisible(false); |
| 186 | ui->output_sink_label->setVisible(false); | 185 | ui->output_sink_label->setVisible(false); |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index c0dbd9855..830096ea0 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -105,10 +105,10 @@ void ConfigureGeneral::SetupPerGameUI() { | |||
| 105 | ui->toggle_background_pause->setVisible(false); | 105 | ui->toggle_background_pause->setVisible(false); |
| 106 | ui->toggle_hide_mouse->setVisible(false); | 106 | ui->toggle_hide_mouse->setVisible(false); |
| 107 | 107 | ||
| 108 | ConfigurationShared::SetColoredTristate(ui->toggle_frame_limit, "toggle_frame_limit", | 108 | ConfigurationShared::SetColoredTristate(ui->toggle_frame_limit, |
| 109 | Settings::values.use_frame_limit, use_frame_limit); | 109 | Settings::values.use_frame_limit, use_frame_limit); |
| 110 | ConfigurationShared::SetColoredTristate(ui->use_multi_core, "use_multi_core", | 110 | ConfigurationShared::SetColoredTristate(ui->use_multi_core, Settings::values.use_multi_core, |
| 111 | Settings::values.use_multi_core, use_multi_core); | 111 | use_multi_core); |
| 112 | 112 | ||
| 113 | connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit, [this]() { | 113 | connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit, [this]() { |
| 114 | ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked() && | 114 | ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked() && |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 3e42531c3..07d818548 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -34,9 +34,8 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) | |||
| 34 | connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, [this] { | 34 | connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, [this] { |
| 35 | UpdateDeviceComboBox(); | 35 | UpdateDeviceComboBox(); |
| 36 | if (!Settings::configuring_global) { | 36 | if (!Settings::configuring_global) { |
| 37 | ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", | 37 | ConfigurationShared::SetHighlight( |
| 38 | ui->api->currentIndex() != | 38 | ui->api_layout, ui->api->currentIndex() != ConfigurationShared::USE_GLOBAL_INDEX); |
| 39 | ConfigurationShared::USE_GLOBAL_INDEX); | ||
| 40 | } | 39 | } |
| 41 | }); | 40 | }); |
| 42 | connect(ui->device, qOverload<int>(&QComboBox::activated), this, | 41 | connect(ui->device, qOverload<int>(&QComboBox::activated), this, |
| @@ -80,17 +79,16 @@ void ConfigureGraphics::SetConfiguration() { | |||
| 80 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); | 79 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); |
| 81 | } else { | 80 | } else { |
| 82 | ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); | 81 | ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); |
| 83 | ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", | 82 | ConfigurationShared::SetHighlight(ui->api_layout, |
| 84 | !Settings::values.renderer_backend.UsingGlobal()); | 83 | !Settings::values.renderer_backend.UsingGlobal()); |
| 85 | ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox, | 84 | ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox, |
| 86 | &Settings::values.aspect_ratio); | 85 | &Settings::values.aspect_ratio); |
| 87 | 86 | ||
| 88 | ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); | 87 | ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); |
| 89 | ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); | 88 | ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); |
| 90 | ConfigurationShared::SetHighlight(ui->ar_label, "ar_label", | 89 | ConfigurationShared::SetHighlight(ui->ar_label, |
| 91 | !Settings::values.aspect_ratio.UsingGlobal()); | 90 | !Settings::values.aspect_ratio.UsingGlobal()); |
| 92 | ConfigurationShared::SetHighlight(ui->bg_layout, "bg_layout", | 91 | ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal()); |
| 93 | !Settings::values.bg_red.UsingGlobal()); | ||
| 94 | } | 92 | } |
| 95 | 93 | ||
| 96 | UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red.GetValue(), | 94 | UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red.GetValue(), |
| @@ -248,20 +246,18 @@ void ConfigureGraphics::SetupPerGameUI() { | |||
| 248 | return; | 246 | return; |
| 249 | } | 247 | } |
| 250 | 248 | ||
| 251 | connect(ui->bg_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, | 249 | connect(ui->bg_combobox, qOverload<int>(&QComboBox::activated), this, [this](int index) { |
| 252 | [this](int index) { | 250 | ui->bg_button->setEnabled(index == 1); |
| 253 | ui->bg_button->setEnabled(index == 1); | 251 | ConfigurationShared::SetHighlight(ui->bg_layout, index == 1); |
| 254 | ConfigurationShared::SetHighlight(ui->bg_layout, "bg_layout", index == 1); | 252 | }); |
| 255 | }); | ||
| 256 | 253 | ||
| 257 | ConfigurationShared::SetColoredTristate(ui->use_disk_shader_cache, "use_disk_shader_cache", | ||
| 258 | Settings::values.use_disk_shader_cache, | ||
| 259 | use_disk_shader_cache); | ||
| 260 | ConfigurationShared::SetColoredTristate( | 254 | ConfigurationShared::SetColoredTristate( |
| 261 | ui->use_asynchronous_gpu_emulation, "use_asynchronous_gpu_emulation", | 255 | ui->use_disk_shader_cache, Settings::values.use_disk_shader_cache, use_disk_shader_cache); |
| 262 | Settings::values.use_asynchronous_gpu_emulation, use_asynchronous_gpu_emulation); | 256 | ConfigurationShared::SetColoredTristate(ui->use_asynchronous_gpu_emulation, |
| 257 | Settings::values.use_asynchronous_gpu_emulation, | ||
| 258 | use_asynchronous_gpu_emulation); | ||
| 263 | 259 | ||
| 264 | ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->ar_label, "ar_label", | 260 | ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->ar_label, |
| 265 | Settings::values.aspect_ratio.GetValue(true)); | 261 | Settings::values.aspect_ratio.GetValue(true)); |
| 266 | ConfigurationShared::InsertGlobalItem( | 262 | ConfigurationShared::InsertGlobalItem( |
| 267 | ui->api, static_cast<int>(Settings::values.renderer_backend.GetValue(true))); | 263 | 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 c5d1a778c..73f276949 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp | |||
| @@ -41,9 +41,9 @@ void ConfigureGraphicsAdvanced::SetConfiguration() { | |||
| 41 | ConfigurationShared::SetPerGameSetting(ui->gpu_accuracy, &Settings::values.gpu_accuracy); | 41 | ConfigurationShared::SetPerGameSetting(ui->gpu_accuracy, &Settings::values.gpu_accuracy); |
| 42 | ConfigurationShared::SetPerGameSetting(ui->anisotropic_filtering_combobox, | 42 | ConfigurationShared::SetPerGameSetting(ui->anisotropic_filtering_combobox, |
| 43 | &Settings::values.max_anisotropy); | 43 | &Settings::values.max_anisotropy); |
| 44 | ConfigurationShared::SetHighlight(ui->label_gpu_accuracy, "label_gpu_accuracy", | 44 | ConfigurationShared::SetHighlight(ui->label_gpu_accuracy, |
| 45 | !Settings::values.gpu_accuracy.UsingGlobal()); | 45 | !Settings::values.gpu_accuracy.UsingGlobal()); |
| 46 | ConfigurationShared::SetHighlight(ui->af_label, "af_label", | 46 | ConfigurationShared::SetHighlight(ui->af_label, |
| 47 | !Settings::values.max_anisotropy.UsingGlobal()); | 47 | !Settings::values.max_anisotropy.UsingGlobal()); |
| 48 | } | 48 | } |
| 49 | } | 49 | } |
| @@ -131,20 +131,18 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() { | |||
| 131 | return; | 131 | return; |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | ConfigurationShared::SetColoredTristate(ui->use_vsync, "use_vsync", Settings::values.use_vsync, | 134 | ConfigurationShared::SetColoredTristate(ui->use_vsync, Settings::values.use_vsync, use_vsync); |
| 135 | use_vsync); | ||
| 136 | ConfigurationShared::SetColoredTristate(ui->use_assembly_shaders, "use_assembly_shaders", | ||
| 137 | Settings::values.use_assembly_shaders, | ||
| 138 | use_assembly_shaders); | ||
| 139 | ConfigurationShared::SetColoredTristate( | 135 | ConfigurationShared::SetColoredTristate( |
| 140 | ui->use_asynchronous_shaders, "use_asynchronous_shaders", | 136 | ui->use_assembly_shaders, Settings::values.use_assembly_shaders, use_assembly_shaders); |
| 141 | Settings::values.use_asynchronous_shaders, use_asynchronous_shaders); | 137 | ConfigurationShared::SetColoredTristate(ui->use_asynchronous_shaders, |
| 142 | ConfigurationShared::SetColoredTristate(ui->use_fast_gpu_time, "use_fast_gpu_time", | 138 | Settings::values.use_asynchronous_shaders, |
| 139 | use_asynchronous_shaders); | ||
| 140 | ConfigurationShared::SetColoredTristate(ui->use_fast_gpu_time, | ||
| 143 | Settings::values.use_fast_gpu_time, use_fast_gpu_time); | 141 | Settings::values.use_fast_gpu_time, use_fast_gpu_time); |
| 144 | ConfigurationShared::SetColoredComboBox( | 142 | ConfigurationShared::SetColoredComboBox( |
| 145 | ui->gpu_accuracy, ui->label_gpu_accuracy, "label_gpu_accuracy", | 143 | ui->gpu_accuracy, ui->label_gpu_accuracy, |
| 146 | static_cast<int>(Settings::values.gpu_accuracy.GetValue(true))); | 144 | static_cast<int>(Settings::values.gpu_accuracy.GetValue(true))); |
| 147 | ConfigurationShared::SetColoredComboBox( | 145 | ConfigurationShared::SetColoredComboBox( |
| 148 | ui->anisotropic_filtering_combobox, ui->af_label, "af_label", | 146 | ui->anisotropic_filtering_combobox, ui->af_label, |
| 149 | static_cast<int>(Settings::values.max_anisotropy.GetValue(true))); | 147 | static_cast<int>(Settings::values.max_anisotropy.GetValue(true))); |
| 150 | } | 148 | } |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 0c4daf147..9ad43ed8f 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -90,13 +90,13 @@ void ConfigureSystem::SetConfiguration() { | |||
| 90 | &Settings::values.time_zone_index); | 90 | &Settings::values.time_zone_index); |
| 91 | ConfigurationShared::SetPerGameSetting(ui->combo_sound, &Settings::values.sound_index); | 91 | ConfigurationShared::SetPerGameSetting(ui->combo_sound, &Settings::values.sound_index); |
| 92 | 92 | ||
| 93 | ConfigurationShared::SetHighlight(ui->label_language, "label_language", | 93 | ConfigurationShared::SetHighlight(ui->label_language, |
| 94 | !Settings::values.language_index.UsingGlobal()); | 94 | !Settings::values.language_index.UsingGlobal()); |
| 95 | ConfigurationShared::SetHighlight(ui->label_region, "label_region", | 95 | ConfigurationShared::SetHighlight(ui->label_region, |
| 96 | !Settings::values.region_index.UsingGlobal()); | 96 | !Settings::values.region_index.UsingGlobal()); |
| 97 | ConfigurationShared::SetHighlight(ui->label_timezone, "label_timezone", | 97 | ConfigurationShared::SetHighlight(ui->label_timezone, |
| 98 | !Settings::values.time_zone_index.UsingGlobal()); | 98 | !Settings::values.time_zone_index.UsingGlobal()); |
| 99 | ConfigurationShared::SetHighlight(ui->label_sound, "label_sound", | 99 | ConfigurationShared::SetHighlight(ui->label_sound, |
| 100 | !Settings::values.sound_index.UsingGlobal()); | 100 | !Settings::values.sound_index.UsingGlobal()); |
| 101 | } | 101 | } |
| 102 | } | 102 | } |
| @@ -224,22 +224,20 @@ void ConfigureSystem::SetupPerGameUI() { | |||
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | ConfigurationShared::SetColoredComboBox(ui->combo_language, ui->label_language, | 226 | ConfigurationShared::SetColoredComboBox(ui->combo_language, ui->label_language, |
| 227 | "label_language", | ||
| 228 | Settings::values.language_index.GetValue(true)); | 227 | Settings::values.language_index.GetValue(true)); |
| 229 | ConfigurationShared::SetColoredComboBox(ui->combo_region, ui->label_region, "label_region", | 228 | ConfigurationShared::SetColoredComboBox(ui->combo_region, ui->label_region, |
| 230 | Settings::values.region_index.GetValue(true)); | 229 | Settings::values.region_index.GetValue(true)); |
| 231 | ConfigurationShared::SetColoredComboBox(ui->combo_time_zone, ui->label_timezone, | 230 | ConfigurationShared::SetColoredComboBox(ui->combo_time_zone, ui->label_timezone, |
| 232 | "label_timezone", | ||
| 233 | Settings::values.time_zone_index.GetValue(true)); | 231 | Settings::values.time_zone_index.GetValue(true)); |
| 234 | ConfigurationShared::SetColoredComboBox(ui->combo_sound, ui->label_sound, "label_sound", | 232 | ConfigurationShared::SetColoredComboBox(ui->combo_sound, ui->label_sound, |
| 235 | Settings::values.sound_index.GetValue(true)); | 233 | Settings::values.sound_index.GetValue(true)); |
| 236 | 234 | ||
| 237 | ConfigurationShared::SetColoredTristate( | 235 | ConfigurationShared::SetColoredTristate( |
| 238 | ui->rng_seed_checkbox, "rng_seed_checkbox", Settings::values.rng_seed.UsingGlobal(), | 236 | ui->rng_seed_checkbox, Settings::values.rng_seed.UsingGlobal(), |
| 239 | Settings::values.rng_seed.GetValue().has_value(), | 237 | Settings::values.rng_seed.GetValue().has_value(), |
| 240 | Settings::values.rng_seed.GetValue(true).has_value(), use_rng_seed); | 238 | Settings::values.rng_seed.GetValue(true).has_value(), use_rng_seed); |
| 241 | ConfigurationShared::SetColoredTristate( | 239 | ConfigurationShared::SetColoredTristate( |
| 242 | ui->custom_rtc_checkbox, "custom_rtc_checkbox", Settings::values.custom_rtc.UsingGlobal(), | 240 | ui->custom_rtc_checkbox, Settings::values.custom_rtc.UsingGlobal(), |
| 243 | Settings::values.custom_rtc.GetValue().has_value(), | 241 | Settings::values.custom_rtc.GetValue().has_value(), |
| 244 | Settings::values.custom_rtc.GetValue(true).has_value(), use_custom_rtc); | 242 | Settings::values.custom_rtc.GetValue(true).has_value(), use_custom_rtc); |
| 245 | } | 243 | } |