GCodeViewer: Fixed crash on start and switch of color mode

(SPE-2340)
This commit is contained in:
YuSanka 2024-06-06 15:13:58 +02:00
parent 357264272d
commit 4cddd3ea85
2 changed files with 9 additions and 0 deletions

View File

@ -2479,6 +2479,9 @@ bool GUI_App::save_mode(const /*ConfigOptionMode*/int mode)
// Update view mode according to selected menu // Update view mode according to selected menu
void GUI_App::update_mode() void GUI_App::update_mode()
{ {
if (is_gcode_viewer())
return;
sidebar().update_mode(); sidebar().update_mode();
mainframe->m_tmp_top_bar->UpdateMode(); mainframe->m_tmp_top_bar->UpdateMode();

View File

@ -1092,6 +1092,12 @@ void MainFrame::on_sys_color_changed()
// update label colors in respect to the system mode // update label colors in respect to the system mode
wxGetApp().init_ui_colours(); wxGetApp().init_ui_colours();
if (wxGetApp().is_gcode_viewer()) {
MenuFactory::sys_color_changed(m_menubar);
return;
}
// but if there are some ui colors in appconfig, they have to be applied // but if there are some ui colors in appconfig, they have to be applied
wxGetApp().update_ui_colours_from_appconfig(); wxGetApp().update_ui_colours_from_appconfig();
#ifdef __WXMSW__ #ifdef __WXMSW__