Only force-show the code widget when first enabling the debugger

Before, any call of Settings::SetDebugModeEnabled(true) would show it. This means that if the debugging UI is enabled, but the user manually closed the code widget, then toggling any option on the interface pane (such as "Pause on Focus Loss") would cause the code widget to reappear. Additionally, closing and reopening dolphin did not call SetDebugModeEnabled, so the code widget did not reappear in that case (it only appeared after touching the interface pane). This is a bit silly, so now only enabling the debugger does it.

This also somewhat resolves an inconsistency introduced by the previous commit: prior to it, --debugger would call SetDebugModeEnabled(true) and thus show the code pane; after these commits, it does not, as it acts like a config change. This is a behavior difference, but not a particularly important one.
This commit is contained in:
Pokechu22 2023-04-17 23:18:42 -07:00
parent c0b6e9e69c
commit 801fa8e905
1 changed files with 2 additions and 2 deletions

View File

@ -465,9 +465,9 @@ void Settings::SetDebugModeEnabled(bool enabled)
{ {
Config::SetBaseOrCurrent(Config::MAIN_ENABLE_DEBUGGING, enabled); Config::SetBaseOrCurrent(Config::MAIN_ENABLE_DEBUGGING, enabled);
emit DebugModeToggled(enabled); emit DebugModeToggled(enabled);
if (enabled)
SetCodeVisible(true);
} }
if (enabled)
SetCodeVisible(true);
} }
bool Settings::IsDebugModeEnabled() const bool Settings::IsDebugModeEnabled() const