diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 801bc09b4c2..187221838c1 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3500,10 +3500,7 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) } else if (keyCode == WXK_CONTROL) m_dirty = true; - else if (keyCode == WXK_TAB && evt.ShiftDown() && !evt.ControlDown() && !wxGetApp().is_gcode_viewer()) { - // Collapse side-panel with Shift+Tab - post_event(SimpleEvent(EVT_GLCANVAS_COLLAPSE_SIDEBAR)); - } else if (m_gizmos.is_enabled() && !m_selection.is_empty() && m_canvas_type != CanvasAssembleView) { + else if (m_gizmos.is_enabled() && !m_selection.is_empty() && m_canvas_type != CanvasAssembleView) { auto _do_rotate = [this](double angle_z_rad) { m_selection.setup_cache(); m_selection.rotate(Vec3d(0.0, 0.0, angle_z_rad), TransformationType(TransformationType::World_Relative_Joint)); @@ -7146,7 +7143,7 @@ void GLCanvas3D::_check_and_update_toolbar_icon_scale() m_main_toolbar.set_scale(sc); m_assemble_view_toolbar.set_scale(sc); m_separator_toolbar.set_scale(sc); - collapse_toolbar.set_scale(sc); + collapse_toolbar.set_scale(sc / 2.0); size *= m_retina_helper->get_scale_factor(); auto* m_notification = wxGetApp().plater()->get_notification_manager(); @@ -7156,7 +7153,7 @@ void GLCanvas3D::_check_and_update_toolbar_icon_scale() m_main_toolbar.set_icons_size(GLGizmosManager::Default_Icons_Size * scale); m_assemble_view_toolbar.set_icons_size(size); m_separator_toolbar.set_icons_size(size); - collapse_toolbar.set_icons_size(size); + collapse_toolbar.set_icons_size(size / 2.0); #endif // ENABLE_RETINA_GL // Update collapse toolbar @@ -7164,9 +7161,9 @@ void GLCanvas3D::_check_and_update_toolbar_icon_scale() //BBS: GUI refactor: GLToolbar #if BBS_TOOLBAR_ON_TOP - float collapse_toolbar_width = collapse_toolbar.is_enabled() ? collapse_toolbar.get_width() : GLToolbar::Default_Icons_Size; + float collapse_toolbar_width = collapse_toolbar.is_enabled() ? collapse_toolbar.get_width() : 0; - float top_tb_width = m_main_toolbar.get_width() + m_gizmos.get_scaled_total_width() + m_assemble_view_toolbar.get_width() + m_separator_toolbar.get_width() + collapse_toolbar_width; + float top_tb_width = m_main_toolbar.get_width() + m_gizmos.get_scaled_total_width() + m_assemble_view_toolbar.get_width() + m_separator_toolbar.get_width() + collapse_toolbar_width * 2; int items_cnt = m_main_toolbar.get_visible_items_cnt() + m_gizmos.get_selectable_icons_cnt() + m_assemble_view_toolbar.get_visible_items_cnt() + m_separator_toolbar.get_visible_items_cnt() + collapse_toolbar.get_visible_items_cnt(); float noitems_width = top_tb_width - size * items_cnt; // width of separators and borders in top toolbars @@ -7221,7 +7218,7 @@ void GLCanvas3D::_render_overlays() m_main_toolbar.set_scale(scale); m_assemble_view_toolbar.set_scale(scale); m_separator_toolbar.set_scale(scale); - wxGetApp().plater()->get_collapse_toolbar().set_scale(scale); + wxGetApp().plater()->get_collapse_toolbar().set_scale(scale / 2.0); m_gizmos.set_overlay_scale(scale); #else // BBS adjust display scale @@ -7234,7 +7231,7 @@ void GLCanvas3D::_render_overlays() m_main_toolbar.set_icons_size(gizmo_size); m_assemble_view_toolbar.set_icons_size(gizmo_size); m_separator_toolbar.set_icons_size(gizmo_size); - wxGetApp().plater()->get_collapse_toolbar().set_icons_size(size); + wxGetApp().plater()->get_collapse_toolbar().set_icons_size(size / 2.0); m_gizmos.set_overlay_icon_size(gizmo_size); #endif // ENABLE_RETINA_GL @@ -7442,7 +7439,7 @@ void GLCanvas3D::_render_gizmos_overlay() float GLCanvas3D::get_main_toolbar_offset() const { const float cnv_width = get_canvas_size().get_width(); - const float collapse_toolbar_width = get_collapse_toolbar_width(); + const float collapse_toolbar_width = get_collapse_toolbar_width() * 2; const float gizmo_width = m_gizmos.get_scaled_total_width(); const float assemble_width = m_assemble_view_toolbar.get_width(); const float separator_width = m_separator_toolbar.get_width(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 31ab8f4df01..23e06faf080 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2565,6 +2565,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) //BBS :partplatelist construction , partplate_list(this->q, &model) { + m_is_dark = wxGetApp().app_config->get("dark_color_mode") == "1"; + m_aui_mgr.SetManagedWindow(q); m_aui_mgr.SetDockSizeConstraint(1, 1); //m_aui_mgr.GetArtProvider()->SetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE, 0); @@ -3183,6 +3185,15 @@ void Plater::priv::collapse_sidebar(bool collapse) return; sidebar_layout.is_collapsed = collapse; + + // Now update the tooltip in the toolbar. + std::string new_tooltip = collapse + ? _u8L("Expand sidebar") + : _u8L("Collapse sidebar"); + new_tooltip += " [Shift+Tab]"; + int id = collapse_toolbar.get_item_id("collapse_sidebar"); + collapse_toolbar.set_tooltip(id, new_tooltip); + update_sidebar(); } @@ -5834,7 +5845,7 @@ void Plater::priv::set_current_panel(wxPanel* panel, bool no_slice) //BBS: add the collapse logic if (panel == preview && q->only_gcode_mode()) { - this->sidebar->collapse(true); + this->enable_sidebar(false); preview->get_canvas3d()->enable_select_plate_toolbar(false); } else if (panel == preview && q->using_exported_file() && (q->m_valid_plates_count <= 1)) {