mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 11:47:54 -06:00
Fix crash on MacOS when clicking filament dropdown in object list (#3205)
* Disable optimization for `RelWithDebInfo` for Clang as well * Fix crash on MacOS (#3134, #3202)
This commit is contained in:
parent
6bb0d5ec30
commit
401ac1adef
2 changed files with 19 additions and 6 deletions
|
@ -5533,12 +5533,6 @@ void GUI::ObjectList::OnStartEditing(wxDataViewEvent &event)
|
|||
// Here the last active column is forgotten, so when leaving the editing mode, the next mouse click will not enter the editing mode of the newly selected column.
|
||||
void ObjectList::OnEditingStarted(wxDataViewEvent &event)
|
||||
{
|
||||
// Orca: Automatically show drop down on editing start and finish editing when the combobox is closed
|
||||
if (event.GetColumn() == colFilament) {
|
||||
::ComboBox*c = static_cast<::ComboBox *>(event.GetDataViewColumn()->GetRenderer()->GetEditorCtrl());
|
||||
c->ToggleDropDown();
|
||||
c->Bind(wxEVT_COMBOBOX_CLOSEUP, [event](wxCommandEvent& evt){ event.GetDataViewColumn()->GetRenderer()->FinishEditing(); });
|
||||
}
|
||||
#ifdef __WXMSW__
|
||||
m_last_selected_column = -1;
|
||||
#else
|
||||
|
@ -5603,6 +5597,15 @@ void ObjectList::OnEditingStarted(wxDataViewEvent &event)
|
|||
SetCustomRendererPtr(dynamic_cast<wxDataViewCustomRenderer*>(renderer));
|
||||
#endif
|
||||
#endif //__WXMSW__
|
||||
|
||||
// Orca: Automatically show drop down on editing start and finish editing when the combobox is closed
|
||||
// Note: this must placed AFTER the above `renderer->StartEditing` call, otherwise `c` will be nullptr on MacOS,
|
||||
// due to the code in MacDarkMode.mm
|
||||
if (event.GetColumn() == colFilament) {
|
||||
::ComboBox*c = static_cast<::ComboBox *>(event.GetDataViewColumn()->GetRenderer()->GetEditorCtrl());
|
||||
c->ToggleDropDown();
|
||||
c->Bind(wxEVT_COMBOBOX_CLOSEUP, [event](wxCommandEvent& evt){ event.GetDataViewColumn()->GetRenderer()->FinishEditing(); });
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectList::OnEditingDone(wxDataViewEvent &event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue