diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 3b224725f6..99cc0de21b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -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 ); diff --git a/src/slic3r/GUI/Widgets/Label.cpp b/src/slic3r/GUI/Widgets/Label.cpp index da5e9b72af..0e5d9eab43 100644 --- a/src/slic3r/GUI/Widgets/Label.cpp +++ b/src/slic3r/GUI/Widgets/Label.cpp @@ -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) {