pcsx2:gui: Display '&' properly in recent ISO list menu

& is used to specify the keyboard shortcut key in menu labels. && must
be used to display an &.

Closes #2148.
This commit is contained in:
Jonathan Li 2017-11-26 22:47:16 +00:00
parent c9abec7cbe
commit 025eef63b5
1 changed files with 6 additions and 1 deletions

View File

@ -188,7 +188,12 @@ void RecentIsoManager::InsertIntoMenu( int id )
if (this->m_firstIdForMenuItems_or_wxID_ANY != wxID_ANY) if (this->m_firstIdForMenuItems_or_wxID_ANY != wxID_ANY)
wxid = this->m_firstIdForMenuItems_or_wxID_ANY + id; wxid = this->m_firstIdForMenuItems_or_wxID_ANY + id;
curitem.ItemPtr = m_Menu->AppendRadioItem( wxid, Path::GetFilename(curitem.Filename), curitem.Filename ); wxString filename = Path::GetFilename(curitem.Filename);
// & is used to specify the keyboard shortcut key in menu labels. && must
// be used to display an &.
filename.Replace("&", "&&", true);
curitem.ItemPtr = m_Menu->AppendRadioItem( wxid, filename, curitem.Filename );
curitem.ItemPtr->Enable(wxFileExists(curitem.Filename) && !g_Conf->AskOnBoot); curitem.ItemPtr->Enable(wxFileExists(curitem.Filename) && !g_Conf->AskOnBoot);
} }