Fix: Filament / Printer areas collapses after closing selection dialogs (#16600)

The Printer and Filament title bars now toggle on mouse down instead of mouse up. Closing a dialog over a title bar could send it a stray mouse up, which folded the section. A double click is also bound so it still toggles twice, and Label passes double clicks to its parent.
This commit is contained in:
yw4z authored and GitHub committed 2026-10-20 19:37:38 -05:00
1 parent 07da005fab
commit 283d40949c
2 files changed
+9 -3

No files matched your search

+8 -2
View File
@@ -2865,7 +2865,8 @@ Sidebar::Sidebar(Plater *parent)
// add printer title
scrolled_sizer->Add(p->m_panel_printer_title, 0, wxEXPAND | wxALL, 0);
p->m_panel_printer_title->Bind(wxEVT_LEFT_UP, [this] (auto & e) {
// ORCA Bind with LEFT_DOWN, since closing a dialog over the title bar can send it a stray LEFT_UP
auto toggle_printer_section = ([this] (wxMouseEvent & e) {
if (!p || !p->combo_printer || !p->m_text_printer_settings || !p->m_panel_printer_content || !m_scrolled_sizer)
return;
// ORCA Show printer name on title when its folded to inform user without expanding it again
@@ -2876,6 +2877,8 @@ Sidebar::Sidebar(Plater *parent)
p->m_panel_printer_separator->Show(isShown);
m_scrolled_sizer->Layout();
});
p->m_panel_printer_title->Bind(wxEVT_LEFT_DOWN , toggle_printer_section);
p->m_panel_printer_title->Bind(wxEVT_LEFT_DCLICK, toggle_printer_section);
// ORCA add bottom border for seperation wile sections folded
p->m_panel_printer_separator = new wxPanel(p->scrolled, wxID_ANY, wxDefaultPosition, wxSize(-1, FromDIP(2))); // ORCA staticline class not works without string
p->m_panel_printer_separator->SetBackgroundColour("#FFFFFF");
@@ -3248,7 +3251,8 @@ Sidebar::Sidebar(Plater *parent)
p->m_panel_filament_title = new StaticBox(p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_NONE);
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) {
// ORCA Bind with LEFT_DOWN, since closing a dialog over the title bar can send it a stray LEFT_UP
auto toggle_filament_section = ([this](wxMouseEvent &e) {
if (!p || !p->m_filament_area_wrapper || !m_scrolled_sizer || !p->m_bpButton_set_filament || !p->m_purge_mode_btn || !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
@@ -3267,6 +3271,8 @@ Sidebar::Sidebar(Plater *parent)
CallAfter([this]{update_filaments_counter(true);}); // call after all UI processing done
});
p->m_panel_filament_title->Bind(wxEVT_LEFT_DOWN , toggle_filament_section);
p->m_panel_filament_title->Bind(wxEVT_LEFT_DCLICK, toggle_filament_section);
wxBoxSizer* bSizer39;
bSizer39 = new wxBoxSizer( wxHORIZONTAL );
+1 -1
View File
@@ -310,7 +310,7 @@ Label::Label(wxWindow *parent, wxFont const &font, wxString const &text, long st
SetBackgroundColour(StaticBox::GetParentBackgroundColor(parent));
SetForegroundColour("#262E30");
if (style & LB_PROPAGATE_MOUSE_EVENT) {
for (auto evt : { wxEVT_LEFT_UP, wxEVT_LEFT_DOWN })
for (auto evt : { wxEVT_LEFT_UP, wxEVT_LEFT_DOWN, wxEVT_LEFT_DCLICK}) // ORCA also propagete LEFT_DCLICK event that used on sidebar titlebars
Bind(evt, [this] (auto & e) { GetParent()->GetEventHandler()->ProcessEventLocally(e); });
};
if (style & LB_AUTO_WRAP) {