diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 77ca0ad4e0..af589a127e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2110,8 +2110,15 @@ Sidebar::Sidebar(Plater *parent) p->m_panel_filament_title->SetBackgroundColor(title_bg); p->m_panel_filament_title->SetBackgroundColor2(0xF1F1F1); p->m_panel_filament_title->Bind(wxEVT_LEFT_UP, [this](wxMouseEvent &e) { - if (e.GetPosition().x > (p->m_flushing_volume_btn->IsShown() - ? p->m_flushing_volume_btn->GetPosition().x : (p->m_bpButton_add_filament->GetPosition().x - FromDIP(30)))) // ORCA exclude area of del button from titlebar collapse/expand feature to fix undesired collapse when user spams del filament button + if (!p || !p->m_panel_filament_content || !m_scrolled_sizer || !p->m_bpButton_set_filament || !p->m_flushing_volume_btn || !p->m_bpButton_add_filament || !ams_btn) + return; + // ORCA exclude area of del button from titlebar collapse/expand feature to fix undesired collapse when user spams del filament button + // also block fold/unfold feature when user clicks to spacing between icons + int exclude_pt = p->m_bpButton_set_filament->GetPosition().x; // maximum fixed item + if (p->m_flushing_volume_btn->IsShown()) exclude_pt = p->m_flushing_volume_btn->GetPosition().x; + else if (p->m_bpButton_add_filament->IsShown()) exclude_pt = p->m_bpButton_add_filament->GetPosition().x - FromDIP(30); // reserve spacing for delete button + else if (ams_btn->IsShown()) exclude_pt = ams_btn->GetPosition().x; + if (e.GetPosition().x > exclude_pt) return; p->m_panel_filament_content->Show(!p->m_panel_filament_content->IsShown()); m_scrolled_sizer->Layout();