diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2025-05-03 18:36:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-03 18:36:36 +0200 |
| commit | dcc09906e58e3731224418544976745d43f2e8d0 (patch) | |
| tree | 12ca481486872ee51eba975ccd26fb29227280b0 /Source/Core | |
| parent | ffd78711beda9aa79046fc04e747a91f49cb4e3c (diff) | |
| parent | c1d0a49f35f8418811ac2f945f35acdfadee0d54 (diff) | |
Merge pull request #13622 from TryTwo/Settings_Bugfix
Settings: Bugfix. GFX settings getting set without user input
Diffstat (limited to 'Source/Core')
3 files changed, 15 insertions, 9 deletions
diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigChoice.cpp b/Source/Core/DolphinQt/Config/ConfigControls/ConfigChoice.cpp index de82f319d5..3c77b2bc3a 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigChoice.cpp +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigChoice.cpp @@ -45,8 +45,8 @@ ConfigStringChoice::ConfigStringChoice(const std::vector<std::pair<QString, QStr for (const auto& [option_text, option_data] : options) addItem(option_text, option_data); - connect(this, &QComboBox::currentIndexChanged, this, &ConfigStringChoice::Update); Load(); + connect(this, &QComboBox::currentIndexChanged, this, &ConfigStringChoice::Update); } void ConfigStringChoice::Update(int index) diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp index b698fbdd77..51c07066d3 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp @@ -79,6 +79,8 @@ void GeneralWidget::CreateWidgets() Config::GFX_CUSTOM_ASPECT_RATIO_WIDTH, m_game_layer); m_custom_aspect_height = new ConfigInteger(1, MAX_CUSTOM_ASPECT_RATIO_RESOLUTION, Config::GFX_CUSTOM_ASPECT_RATIO_HEIGHT, m_game_layer); + ToggleCustomAspectRatio(m_aspect_combo->currentIndex()); + m_adapter_combo = new ToolTipComboBox; m_enable_vsync = new ConfigBool(tr("V-Sync"), Config::GFX_VSYNC, m_game_layer); m_enable_fullscreen = @@ -169,14 +171,17 @@ void GeneralWidget::ConnectWidgets() Config::SetBaseOrCurrent(Config::GFX_ADAPTER, index); emit BackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND))); }); - connect(m_aspect_combo, qOverload<int>(&QComboBox::currentIndexChanged), this, [&](int index) { - const bool is_custom_aspect_ratio = (index == static_cast<int>(AspectMode::Custom)) || - (index == static_cast<int>(AspectMode::CustomStretch)); - m_custom_aspect_label->setHidden(!is_custom_aspect_ratio); - m_custom_aspect_width->setHidden(!is_custom_aspect_ratio); - m_custom_aspect_height->setHidden(!is_custom_aspect_ratio); - }); - m_aspect_combo->currentIndexChanged(m_aspect_combo->currentIndex()); + connect(m_aspect_combo, &QComboBox::currentIndexChanged, this, + &GeneralWidget::ToggleCustomAspectRatio); +} + +void GeneralWidget::ToggleCustomAspectRatio(int index) +{ + const bool is_custom_aspect_ratio = (index == static_cast<int>(AspectMode::Custom)) || + (index == static_cast<int>(AspectMode::CustomStretch)); + m_custom_aspect_label->setHidden(!is_custom_aspect_ratio); + m_custom_aspect_width->setHidden(!is_custom_aspect_ratio); + m_custom_aspect_height->setHidden(!is_custom_aspect_ratio); } void GeneralWidget::BackendWarning() diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h index 42f74229d8..30849234f3 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h @@ -40,6 +40,7 @@ private: void BackendWarning(); void CreateWidgets(); + void ToggleCustomAspectRatio(int index); void ConnectWidgets(); void AddDescriptions(); |
