mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-12 10:37:02 +00:00
Put recent files into a submenu
This commit is contained in:
parent
d54fb0ba78
commit
824068e3cd
1 changed files with 13 additions and 6 deletions
|
|
@ -2109,7 +2109,8 @@ void MainWindow::RecreateMenu()
|
||||||
m_loadMenuItem = m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_LOAD, _("&Load..."));
|
m_loadMenuItem = m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_LOAD, _("&Load..."));
|
||||||
m_installUpdateMenuItem = m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_INSTALL_UPDATE, _("&Install game title, update or DLC..."));
|
m_installUpdateMenuItem = m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_INSTALL_UPDATE, _("&Install game title, update or DLC..."));
|
||||||
|
|
||||||
sint32 recentFileIndex = 0;
|
wxMenu* recentMenu = new wxMenu();
|
||||||
|
sint32 recentFileIndex = 1;
|
||||||
m_fileMenuSeparator0 = nullptr;
|
m_fileMenuSeparator0 = nullptr;
|
||||||
m_fileMenuSeparator1 = nullptr;
|
m_fileMenuSeparator1 = nullptr;
|
||||||
for (size_t i = 0; i < guiConfig.recent_launch_files.size(); i++)
|
for (size_t i = 0; i < guiConfig.recent_launch_files.size(); i++)
|
||||||
|
|
@ -2117,15 +2118,21 @@ void MainWindow::RecreateMenu()
|
||||||
const std::string& pathStr = guiConfig.recent_launch_files[i];
|
const std::string& pathStr = guiConfig.recent_launch_files[i];
|
||||||
if (pathStr.empty())
|
if (pathStr.empty())
|
||||||
continue;
|
continue;
|
||||||
if (recentFileIndex == 0)
|
recentMenu->Append(MAINFRAME_MENU_ID_FILE_RECENT_0 + i, to_wxString(fmt::format("{}. {}", recentFileIndex, pathStr)));
|
||||||
m_fileMenuSeparator0 = m_fileMenu->AppendSeparator();
|
|
||||||
m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_RECENT_0 + i, to_wxString(fmt::format("{}. {}", recentFileIndex, pathStr)));
|
|
||||||
recentFileIndex++;
|
recentFileIndex++;
|
||||||
|
|
||||||
if (recentFileIndex >= 8)
|
if (recentFileIndex >= 10)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_fileMenuSeparator1 = m_fileMenu->AppendSeparator();
|
if (recentFileIndex == 0)
|
||||||
|
{
|
||||||
|
wxMenuItem* placeholder = recentMenu->Append(wxID_NONE, _("(No recent files)"));
|
||||||
|
placeholder->Enable(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_fileMenu->AppendSeparator();
|
||||||
|
m_fileMenu->AppendSubMenu(recentMenu, _("Recent files"));
|
||||||
|
m_fileMenu->AppendSeparator();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue