Fix two minor UI problems in the Bombs demo

Error 1: When enabling/disabling easy corner, the enable/disable text
was mixed up. This resulted in being asked to confirm disabling easy
corner, when it was being enabled, and vice versa.

Error 2: When choosing not to switch easy corner, the checkmark in the
menu showing it's state still swapped.

Fix 1: Swap the text for enable/disable in the confirm easy mode toggle
dialog box.

Fix 2: Call GetMenuBar()->Check(bombsID_EASYCORNER, m_easyCorner);
(Check always returns void, and GetMenuBar is only called from the
MenuBar, after it's been set up) to set the checkmark's state, when
needed.

Closes #22764.
This commit is contained in:
Night-Wisp 2022-08-30 19:51:04 -06:00 committed by Vadim Zeitlin
parent d9a78be16c
commit e7521d7b2c

View file

@ -183,9 +183,9 @@ void BombsFrame::OnEasyCorner(wxCommandEvent& WXUNUSED(event))
{ {
wxString msg; wxString msg;
if(m_easyCorner) if(m_easyCorner)
msg = wxT("enable");
else
msg = wxT("disable"); msg = wxT("disable");
else
msg = wxT("enable");
msg = wxT("Do you really want to ") + msg + wxT(" having\ntop left corner always empty for easier start?"); msg = wxT("Do you really want to ") + msg + wxT(" having\ntop left corner always empty for easier start?");
@ -196,7 +196,12 @@ void BombsFrame::OnEasyCorner(wxCommandEvent& WXUNUSED(event))
this this
); );
if(ok!=wxYES)return; if(ok!=wxYES)
{
// Undo the automatic change to the menu bar, keeping it in sync with the actual option value.
GetMenuBar()->Check(bombsID_EASYCORNER, m_easyCorner);
return;
}
m_easyCorner = !m_easyCorner; m_easyCorner = !m_easyCorner;