From 1cdd11d9f5541ba9b49baf3dddcb7e411f035669 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Wed, 23 Aug 2023 14:26:34 -0400 Subject: [PATCH] main: Fix docked mode button, clang 14 error --- src/yuzu/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 3f126d9d18..99961ca3ea 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1158,9 +1158,9 @@ void GMainWindow::InitializeWidgets() { [this](const QPoint& menu_location) { QMenu context_menu; - for (auto const& [value, text] : Config::use_docked_mode_texts_map) { - context_menu.addAction(text, [&] { - if (value != Settings::values.use_docked_mode.GetValue()) { + for (auto const& pair : Config::use_docked_mode_texts_map) { + context_menu.addAction(pair.second, [this, &pair] { + if (pair.first != Settings::values.use_docked_mode.GetValue()) { OnToggleDockedMode(); } }); @@ -3650,8 +3650,8 @@ void GMainWindow::OnToggleDockedMode() { controller_dialog->refreshConfiguration(); } - Settings::values.use_docked_mode.SetValue(is_docked ? Settings::ConsoleMode::Docked - : Settings::ConsoleMode::Handheld); + Settings::values.use_docked_mode.SetValue(is_docked ? Settings::ConsoleMode::Handheld + : Settings::ConsoleMode::Docked); UpdateDockedButton(); OnDockedModeChanged(is_docked, !is_docked, *system); } @@ -4082,7 +4082,7 @@ void GMainWindow::UpdateGPUAccuracyButton() { void GMainWindow::UpdateDockedButton() { const auto console_mode = Settings::values.use_docked_mode.GetValue(); - dock_status_button->setChecked(console_mode == Settings::ConsoleMode::Docked); + dock_status_button->setChecked(Settings::IsDockedMode()); dock_status_button->setText( Config::use_docked_mode_texts_map.find(console_mode)->second.toUpper()); }