diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 53c309abd1..51a9a6d4eb 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -805,14 +805,6 @@ static const ImWchar ranges_keyboard_shortcuts[] = std::vector ImGuiWrapper::load_svg(const std::string& bitmap_name, unsigned target_width, unsigned target_height) { -#ifdef __APPLE__ - // Note: win->GetContentScaleFactor() is not used anymore here because it tends to - // return bogus results quite often (such as 1.0 on Retina or even 0.0). - // We're using the max scaling factor across all screens because it's very likely to be good enough. - double scale = mac_max_scaling_factor(); -#else - double scale = 1.0; -#endif std::vector empty_vector; #ifdef __WXMSW__ @@ -827,8 +819,6 @@ std::vector ImGuiWrapper::load_svg(const std::string& bitmap_name if (image == nullptr) return empty_vector; - target_height != 0 ? target_height *= scale : target_width *= scale; - float svg_scale = target_height != 0 ? (float)target_height / image->height : target_width != 0 ? (float)target_width / image->width : 1; diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 8c268ed001..69fa4b86be 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -190,6 +190,27 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S event.Skip(); }); + Bind(wxEVT_SYS_COLOUR_CHANGED, [this](wxSysColourChangedEvent& event) + { + bool recreate_gui = false; + { + // the dialog needs to be destroyed before the call to recreate_gui() + // or sometimes the application crashes into wxDialogBase() destructor + // so we put it into an inner scope + wxMessageDialog dialog(nullptr, + _L("System color mode was changed. " + "It is possible to update the Slicer in respect to the system mode.") + "\n" + + _L("You will lose content of the plater.") + "\n\n" + + _L("Do you want to proceed?"), + wxString(SLIC3R_APP_NAME) + " - " + _L("Switching system color mode"), + wxICON_QUESTION | wxOK | wxCANCEL); + recreate_gui = dialog.ShowModal() == wxID_OK; + } + if (recreate_gui) + wxGetApp().recreate_GUI(_L("Changing of an application in respect to the system mode") + dots); + event.Skip(); + }); + wxGetApp().persist_window_geometry(this, true); update_ui_from_settings(); // FIXME (?)