Fix: Filament section not foldable on launch for toolchanger / idex printers (#14406)

* init

* Update Plater.cpp
This commit is contained in:
yw4z
2026-07-01 12:21:40 +03:00
committed by GitHub
parent 8d84204aeb
commit 49fe64cb07

View File

@@ -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();