From fce1943b943b7ec7dff084221d2c2125d96f771f Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 19 May 2020 16:50:39 +0200 Subject: [PATCH] OSX specific bug fixing --- src/slic3r/GUI/GLCanvas3D.cpp | 2 +- src/slic3r/GUI/Search.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index ae9e4f929b..33b8e9b21d 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -5437,7 +5437,7 @@ void GLCanvas3D::_check_and_update_toolbar_icon_scale() const // set minimum scale as a auto scale for the toolbars float new_scale = std::min(new_h_scale, new_v_scale); - if (fabs(new_scale - scale) > EPSILON) + if (fabs(new_scale - scale) > 0.01) // scale is changed by 1% and more wxGetApp().set_auto_toolbar_icon_scale(new_scale); } diff --git a/src/slic3r/GUI/Search.cpp b/src/slic3r/GUI/Search.cpp index 22ac7b70f9..3db1937b57 100644 --- a/src/slic3r/GUI/Search.cpp +++ b/src/slic3r/GUI/Search.cpp @@ -483,6 +483,13 @@ SearchDialog::SearchDialog(OptionsSearcher* searcher) search_list->GetMainWindow()->Bind(wxEVT_LEFT_DOWN, &SearchDialog::OnLeftDown, this); #endif //__WXMSW__ + // Under OSX mouse and key states didn't fill after wxEVT_DATAVIEW_SELECTION_CHANGED call + // As a result, we can't to identify what kind of actions was done + // So, under OSX is used OnKeyDown function to navigate inside the list +#ifndef __APPLE__ + search_list->Bind(wxEVT_KEY_DOWN, &SearchDialog::OnKeyDown, this); +#endif + check_category->Bind(wxEVT_CHECKBOX, &SearchDialog::OnCheck, this); if (check_english) check_english ->Bind(wxEVT_CHECKBOX, &SearchDialog::OnCheck, this); @@ -585,11 +592,16 @@ void SearchDialog::OnSelect(wxDataViewEvent& event) if (prevent_list_events) return; + // Under OSX mouse and key states didn't fill after wxEVT_DATAVIEW_SELECTION_CHANGED call + // As a result, we can't to identify what kind of actions was done + // So, under OSX is used OnKeyDown function to navigate inside the list +#ifndef __APPLE__ // wxEVT_DATAVIEW_SELECTION_CHANGED is processed, when selection is changed after mouse click or press the Up/Down arrows // But this two cases should be processed in different way: // Up/Down arrows -> leave it as it is (just a navigation) // LeftMouseClick -> call the ProcessSelection function if (wxGetMouseState().LeftIsDown()) +#endif //__APPLE__ ProcessSelection(search_list->GetSelection()); }