diff options
| -rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 14 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 13 |
4 files changed, 16 insertions, 27 deletions
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index fdae83c64..625dd75dd 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -37,7 +37,7 @@ void ConfigureGeneral::SetConfiguration() { | |||
| 37 | const bool runtime_lock = !system.IsPoweredOn(); | 37 | const bool runtime_lock = !system.IsPoweredOn(); |
| 38 | QLayout& layout = *ui->general_widget->layout(); | 38 | QLayout& layout = *ui->general_widget->layout(); |
| 39 | 39 | ||
| 40 | std::map<std::string, QWidget*> hold{}; | 40 | std::map<u32, QWidget*> hold{}; |
| 41 | 41 | ||
| 42 | for (const auto setting : | 42 | for (const auto setting : |
| 43 | UISettings::values.linkage.by_category[Settings::Category::UiGeneral]) { | 43 | UISettings::values.linkage.by_category[Settings::Category::UiGeneral]) { |
| @@ -49,10 +49,10 @@ void ConfigureGeneral::SetConfiguration() { | |||
| 49 | continue; | 49 | continue; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | hold.insert({setting->GetLabel(), widget}); | 52 | hold.emplace(setting->Id(), widget); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | for (const auto& [label, widget] : hold) { | 55 | for (const auto& [id, widget] : hold) { |
| 56 | layout.addWidget(widget); | 56 | layout.addWidget(widget); |
| 57 | } | 57 | } |
| 58 | } | 58 | } |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index a4dac659f..59702603a 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -226,12 +226,10 @@ void ConfigureGraphics::Setup() { | |||
| 226 | 226 | ||
| 227 | QLayout& graphics_layout = *ui->graphics_widget->layout(); | 227 | QLayout& graphics_layout = *ui->graphics_widget->layout(); |
| 228 | 228 | ||
| 229 | std::map<bool, std::map<std::string, QWidget*>> hold_graphics; | 229 | std::map<u32, QWidget*> hold_graphics; |
| 230 | std::forward_list<QWidget*> hold_api; | 230 | std::forward_list<QWidget*> hold_api; |
| 231 | 231 | ||
| 232 | for (const auto setting : Settings::values.linkage.by_category[Settings::Category::Renderer]) { | 232 | for (const auto setting : Settings::values.linkage.by_category[Settings::Category::Renderer]) { |
| 233 | const auto& setting_label = setting->GetLabel(); | ||
| 234 | |||
| 235 | ConfigurationShared::Widget* widget = [&]() { | 233 | ConfigurationShared::Widget* widget = [&]() { |
| 236 | if (setting->Id() == Settings::values.vulkan_device.Id() || | 234 | if (setting->Id() == Settings::values.vulkan_device.Id() || |
| 237 | setting->Id() == Settings::values.shader_backend.Id() || | 235 | setting->Id() == Settings::values.shader_backend.Id() || |
| @@ -284,16 +282,14 @@ void ConfigureGraphics::Setup() { | |||
| 284 | shader_backend_widget = widget; | 282 | shader_backend_widget = widget; |
| 285 | } else if (setting->Id() == Settings::values.vsync_mode.Id()) { | 283 | } else if (setting->Id() == Settings::values.vsync_mode.Id()) { |
| 286 | vsync_mode_combobox = widget->combobox; | 284 | vsync_mode_combobox = widget->combobox; |
| 287 | hold_graphics[setting->IsEnum()][setting_label] = widget; | 285 | hold_graphics.emplace(setting->Id(), widget); |
| 288 | } else { | 286 | } else { |
| 289 | hold_graphics[setting->IsEnum()][setting_label] = widget; | 287 | hold_graphics.emplace(setting->Id(), widget); |
| 290 | } | 288 | } |
| 291 | } | 289 | } |
| 292 | 290 | ||
| 293 | for (const auto& [_, settings] : hold_graphics) { | 291 | for (const auto& [id, widget] : hold_graphics) { |
| 294 | for (const auto& [label, widget] : settings) { | 292 | graphics_layout.addWidget(widget); |
| 295 | graphics_layout.addWidget(widget); | ||
| 296 | } | ||
| 297 | } | 293 | } |
| 298 | 294 | ||
| 299 | for (auto widget : hold_api) { | 295 | for (auto widget : hold_api) { |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index c5e21da02..8c932f10a 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp | |||
| @@ -31,7 +31,7 @@ ConfigureGraphicsAdvanced::~ConfigureGraphicsAdvanced() = default; | |||
| 31 | void ConfigureGraphicsAdvanced::SetConfiguration() { | 31 | void ConfigureGraphicsAdvanced::SetConfiguration() { |
| 32 | const bool runtime_lock = !system.IsPoweredOn(); | 32 | const bool runtime_lock = !system.IsPoweredOn(); |
| 33 | auto& layout = *ui->populate_target->layout(); | 33 | auto& layout = *ui->populate_target->layout(); |
| 34 | std::map<std::string, QWidget*> hold{}; // A map will sort the data for us | 34 | std::map<u32, QWidget*> hold{}; // A map will sort the data for us |
| 35 | 35 | ||
| 36 | for (auto setting : | 36 | for (auto setting : |
| 37 | Settings::values.linkage.by_category[Settings::Category::RendererAdvanced]) { | 37 | Settings::values.linkage.by_category[Settings::Category::RendererAdvanced]) { |
| @@ -43,17 +43,13 @@ void ConfigureGraphicsAdvanced::SetConfiguration() { | |||
| 43 | continue; | 43 | continue; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | if (!setting->IsEnum()) { | 46 | hold.emplace(setting->Id(), widget); |
| 47 | hold.emplace(setting->GetLabel(), widget); | ||
| 48 | } else { | ||
| 49 | layout.addWidget(widget); | ||
| 50 | } | ||
| 51 | 47 | ||
| 52 | if (setting->Id() == Settings::values.enable_compute_pipelines.Id()) { | 48 | if (setting->Id() == Settings::values.enable_compute_pipelines.Id()) { |
| 53 | checkbox_enable_compute_pipelines = widget; | 49 | checkbox_enable_compute_pipelines = widget; |
| 54 | } | 50 | } |
| 55 | } | 51 | } |
| 56 | for (const auto& [label, widget] : hold) { | 52 | for (const auto& [id, widget] : hold) { |
| 57 | layout.addWidget(widget); | 53 | layout.addWidget(widget); |
| 58 | } | 54 | } |
| 59 | } | 55 | } |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index ae59d2ee7..4b0e0a649 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -109,8 +109,8 @@ void ConfigureSystem::Setup() { | |||
| 109 | auto& core_layout = *ui->core_widget->layout(); | 109 | auto& core_layout = *ui->core_widget->layout(); |
| 110 | auto& system_layout = *ui->system_widget->layout(); | 110 | auto& system_layout = *ui->system_widget->layout(); |
| 111 | 111 | ||
| 112 | std::map<std::string, QWidget*> core_hold{}; | 112 | std::map<u32, QWidget*> core_hold{}; |
| 113 | std::map<bool, std::map<std::string, QWidget*>> system_hold{}; | 113 | std::map<u32, QWidget*> system_hold{}; |
| 114 | 114 | ||
| 115 | std::forward_list<Settings::BasicSetting*> settings; | 115 | std::forward_list<Settings::BasicSetting*> settings; |
| 116 | auto push = [&settings](std::forward_list<Settings::BasicSetting*>& list) { | 116 | auto push = [&settings](std::forward_list<Settings::BasicSetting*>& list) { |
| @@ -165,10 +165,10 @@ void ConfigureSystem::Setup() { | |||
| 165 | 165 | ||
| 166 | switch (setting->Category()) { | 166 | switch (setting->Category()) { |
| 167 | case Settings::Category::Core: | 167 | case Settings::Category::Core: |
| 168 | core_hold[setting->GetLabel()] = widget; | 168 | core_hold.emplace(setting->Id(), widget); |
| 169 | break; | 169 | break; |
| 170 | case Settings::Category::System: | 170 | case Settings::Category::System: |
| 171 | system_hold[setting->IsEnum()].insert(std::pair{setting->GetLabel(), widget}); | 171 | system_hold.emplace(setting->Id(), widget); |
| 172 | break; | 172 | break; |
| 173 | default: | 173 | default: |
| 174 | delete widget; | 174 | delete widget; |
| @@ -177,10 +177,7 @@ void ConfigureSystem::Setup() { | |||
| 177 | for (const auto& [label, widget] : core_hold) { | 177 | for (const auto& [label, widget] : core_hold) { |
| 178 | core_layout.addWidget(widget); | 178 | core_layout.addWidget(widget); |
| 179 | } | 179 | } |
| 180 | for (const auto& [label, widget] : system_hold[true]) { | 180 | for (const auto& [id, widget] : system_hold) { |
| 181 | system_layout.addWidget(widget); | ||
| 182 | } | ||
| 183 | for (const auto& [label, widget] : system_hold[false]) { | ||
| 184 | system_layout.addWidget(widget); | 181 | system_layout.addWidget(widget); |
| 185 | } | 182 | } |
| 186 | } | 183 | } |