From 000fab52613916becd0408c6fa2d052341bcc9ff Mon Sep 17 00:00:00 2001 From: "liz.li" Date: Thu, 6 Apr 2023 09:37:35 +0800 Subject: [PATCH] FIX: thumbnail in preview display problem(STUDIO-2578) after a .gcode.3mf file loaded, the thumbnail in preview will not show until click the canvas3D region. Change-Id: Ia58e5a44ea3dc87ac7609d434aebbf0e89cf3023 --- src/slic3r/GUI/GLCanvas3D.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 1a0d9b53f..2963cd7b9 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2888,6 +2888,7 @@ void GLCanvas3D::on_idle(wxIdleEvent& evt) // BBS //m_dirty |= wxGetApp().plater()->get_view_toolbar().update_items_state(); m_dirty |= wxGetApp().plater()->get_collapse_toolbar().update_items_state(); + _update_imgui_select_plate_toolbar(); bool mouse3d_controller_applied = wxGetApp().plater()->get_mouse3d_controller().apply(wxGetApp().plater()->get_camera()); m_dirty |= mouse3d_controller_applied; m_dirty |= wxGetApp().plater()->get_notification_manager()->update_notifications(*this); @@ -6140,7 +6141,6 @@ bool GLCanvas3D::_init_select_plate_toolbar() bool result = item->image_texture.load_from_svg_file(path + "im_all_plates_stats.svg", false, false, false, 128); result = result && item->image_texture_transparent.load_from_svg_file(path + "im_all_plates_stats_transparent.svg", false, false, false, 128); m_sel_plate_toolbar.m_all_plates_stats_item = item; - return result; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 7dcd70924..afc88105b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5337,6 +5337,18 @@ void Plater::priv::set_current_panel(wxPanel* panel, bool no_slice) preview->set_as_dirty(); }; + //BBS: add the collapse logic + if (panel == preview && q->only_gcode_mode()) { + this->sidebar->collapse(true); + preview->get_canvas3d()->enable_select_plate_toolbar(false); + } + else if (panel == preview && q->using_exported_file() && (q->m_valid_plates_count <= 1)) { + preview->get_canvas3d()->enable_select_plate_toolbar(false); + } + else { + preview->get_canvas3d()->enable_select_plate_toolbar(true); + } + if (current_panel == panel) { //BBS: add slice logic when switch to preview page @@ -5362,17 +5374,6 @@ void Plater::priv::set_current_panel(wxPanel* panel, bool no_slice) } //#endif current_panel = panel; - //BBS: add the collapse logic - if (current_panel == preview && q->only_gcode_mode()) { - this->sidebar->collapse(true); - preview->get_canvas3d()->enable_select_plate_toolbar(false); - } - else if (current_panel == preview && q->using_exported_file() && (q->m_valid_plates_count <= 1)) { - preview->get_canvas3d()->enable_select_plate_toolbar(false); - } - else { - preview->get_canvas3d()->enable_select_plate_toolbar(true); - } // to reduce flickering when changing view, first set as visible the new current panel for (wxPanel* p : panels) {