Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_gcode_viewer

This commit is contained in:
enricoturri1966 2020-06-29 15:28:37 +02:00
commit 8bb3c10492
3 changed files with 13 additions and 13 deletions

View file

@ -1094,10 +1094,10 @@ void GUI_App::add_config_menu(wxMenuBar *menu)
}
#if ENABLE_LAYOUT_NO_RESTART
if (app_layout_changed) {
mainframe->Hide();
mainframe->GetSizer()->Hide((size_t)0);
mainframe->update_layout();
mainframe->select_tab(0);
mainframe->Show();
mainframe->GetSizer()->Show((size_t)0);
}
#else
if (recreate_app)

View file

@ -159,7 +159,9 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
#endif // !ENABLE_LAYOUT_NO_RESTART
// initialize layout
auto sizer = new wxBoxSizer(wxVERTICAL);
m_main_sizer = new wxBoxSizer(wxVERTICAL);
wxSizer* sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add(m_main_sizer, 1, wxEXPAND);
#if ENABLE_LAYOUT_NO_RESTART
SetSizer(sizer);
// initialize layout from config
@ -311,7 +313,7 @@ void MainFrame::update_layout()
if (m_layout == ESettingsLayout::Dlg)
rescale_dialog_after_dpi_change(*this, m_settings_dialog, ERescaleTarget::Mainframe);
clean_sizer(GetSizer());
clean_sizer(m_main_sizer);
clean_sizer(m_settings_dialog.GetSizer());
if (m_settings_dialog.IsShown())
@ -357,16 +359,16 @@ void MainFrame::update_layout()
{
m_plater->Reparent(m_tabpanel);
m_tabpanel->InsertPage(0, m_plater, _L("Plater"));
GetSizer()->Add(m_tabpanel, 1, wxEXPAND);
m_main_sizer->Add(m_tabpanel, 1, wxEXPAND);
m_plater->Show();
m_tabpanel->Show();
break;
}
case ESettingsLayout::New:
{
GetSizer()->Add(m_plater, 1, wxEXPAND);
m_main_sizer->Add(m_plater, 1, wxEXPAND);
m_tabpanel->Hide();
GetSizer()->Add(m_tabpanel, 1, wxEXPAND);
m_main_sizer->Add(m_tabpanel, 1, wxEXPAND);
m_plater_page = new wxPanel(m_tabpanel);
m_tabpanel->InsertPage(0, m_plater_page, _L("Plater")); // empty panel just for Plater tab */
m_plater->Show();
@ -374,7 +376,7 @@ void MainFrame::update_layout()
}
case ESettingsLayout::Dlg:
{
GetSizer()->Add(m_plater, 1, wxEXPAND);
m_main_sizer->Add(m_plater, 1, wxEXPAND);
m_tabpanel->Reparent(&m_settings_dialog);
m_settings_dialog.GetSizer()->Add(m_tabpanel, 1, wxEXPAND);
@ -1881,13 +1883,10 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
}
#if ENABLE_LAYOUT_NO_RESTART
else if (m_layout == ESettingsLayout::New) {
m_main_sizer->Show(m_plater, tab == 0);
m_main_sizer->Show(m_tabpanel, tab != 0);
#else
else if (m_layout == slNew) {
#endif // ENABLE_LAYOUT_NO_RESTART
#if ENABLE_LAYOUT_NO_RESTART
GetSizer()->Show(m_plater, tab == 0);
GetSizer()->Show(m_tabpanel, tab != 0);
#else
m_plater->Show(tab == 0);
m_tabpanel->Show(tab != 0);
#endif // ENABLE_LAYOUT_NO_RESTART

View file

@ -89,6 +89,7 @@ class MainFrame : public DPIFrame
wxMenuItem* m_menu_item_repeat { nullptr }; // doesn't used now
#endif
wxMenuItem* m_menu_item_reslice_now { nullptr };
wxSizer* m_main_sizer{ nullptr };
PrintHostQueueDialog *m_printhost_queue_dlg;