TopBar: Fixed a crash on switch print technology

This commit is contained in:
YuSanka 2024-03-20 09:57:35 +01:00 committed by David Kocik
parent 83ce1d600a
commit f05318686c

View File

@ -383,6 +383,8 @@ static void add_tabs_as_menu(wxMenuBar* bar, MainFrame* main_frame, wxWindow* ba
void MainFrame::show_tabs_menu(bool show)
{
if (!m_menubar)
return;
if (show)
append_tab_menu_items_to_menubar(m_menubar, plater() ? plater()->printer_technology() : ptFFF, true);
else
@ -2192,6 +2194,8 @@ void MainFrame::add_to_recent_projects(const wxString& filename)
void MainFrame::technology_changed()
{
if (!m_menubar)
return;
// update menu titles
PrinterTechnology pt = plater()->printer_technology();
if (int id = m_menubar->FindMenu(pt == ptFFF ? _L("Material Settings") : _L("Filament Settings")); id != wxNOT_FOUND)