diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index 1c21e2f86..fe6c349b4 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -52,9 +52,6 @@ // Enable error logging for OpenGL calls when SLIC3R_LOGLEVEL >= 5 #define ENABLE_OPENGL_ERROR_LOGGING (1 && ENABLE_2_3_0_ALPHA1) -// Enable built-in DPI changed event handler of wxWidgets 3.1.3 -#define ENABLE_WX_3_1_3_DPI_CHANGED_EVENT (1 && ENABLE_2_3_0_ALPHA1) - //==================== // 2.3.0.alpha3 techs diff --git a/src/slic3r/GUI/GUI_Utils.hpp b/src/slic3r/GUI/GUI_Utils.hpp index dbb200f83..4f02c6c23 100644 --- a/src/slic3r/GUI/GUI_Utils.hpp +++ b/src/slic3r/GUI/GUI_Utils.hpp @@ -26,11 +26,7 @@ class wxCheckBox; class wxTopLevelWindow; class wxRect; -#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT #define wxVERSION_EQUAL_OR_GREATER_THAN(major, minor, release) ((wxMAJOR_VERSION > major) || ((wxMAJOR_VERSION == major) && (wxMINOR_VERSION > minor)) || ((wxMAJOR_VERSION == major) && (wxMINOR_VERSION == minor) && (wxRELEASE_NUMBER >= release))) -#else -#define wxVERSION_EQUAL_OR_GREATER_THAN(major, minor, release) 0 -#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT namespace Slic3r { namespace GUI { @@ -99,12 +95,12 @@ public: // Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3). // So, calculate the m_em_unit value from the font size, as before -#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT && !defined(__WXGTK__) +#if !defined(__WXGTK__) m_em_unit = std::max(10, 10.0f * m_scale_factor); #else // initialize default width_unit according to the width of the one symbol ("m") of the currently active font of this window. m_em_unit = std::max(10, this->GetTextExtent("m").x - 1); -#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT +#endif // __WXGTK__ // recalc_font(); @@ -235,11 +231,7 @@ private: m_normal_font = this->GetFont(); // update em_unit value for new window font -#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT m_em_unit = std::max(10, 10.0f * m_scale_factor); -#else - m_em_unit = std::max(10, this->GetTextExtent("m").x - 1); -#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT // rescale missed controls sizes and images on_dpi_changed(suggested_rect); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 386a150f7..91357ff6c 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -803,11 +803,7 @@ bool MainFrame::can_reslice() const void MainFrame::on_dpi_changed(const wxRect& suggested_rect) { -#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT wxGetApp().update_fonts(this); -#else - wxGetApp().update_fonts(); -#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT this->SetFont(this->normal_font()); // update Plater @@ -1848,14 +1844,14 @@ SettingsDialog::SettingsDialog(MainFrame* mainframe) if (wxGetApp().is_gcode_viewer()) return; -#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT && defined(__WXMSW__) +#if defined(__WXMSW__) // ys_FIXME! temporary workaround for correct font scaling // Because of from wxWidgets 3.1.3 auto rescaling is implemented for the Fonts, // From the very beginning set dialog font to the wxSYS_DEFAULT_GUI_FONT this->SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); #else this->SetFont(wxGetApp().normal_font()); -#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT +#endif // __WXMSW__ this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); // Load the icon either from the exe, or from the ico file. diff --git a/src/slic3r/GUI/SavePresetDialog.cpp b/src/slic3r/GUI/SavePresetDialog.cpp index e659f8e02..9c5e72fde 100644 --- a/src/slic3r/GUI/SavePresetDialog.cpp +++ b/src/slic3r/GUI/SavePresetDialog.cpp @@ -209,12 +209,12 @@ SavePresetDialog::~SavePresetDialog() void SavePresetDialog::build(std::vector types, std::string suffix) { SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); -#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT && defined(__WXMSW__) +#if defined(__WXMSW__) // ys_FIXME! temporary workaround for correct font scaling // Because of from wxWidgets 3.1.3 auto rescaling is implemented for the Fonts, // From the very beginning set dialog font to the wxSYS_DEFAULT_GUI_FONT this->SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); -#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT +#endif // __WXMSW__ if (suffix.empty()) suffix = _CTX_utf8(L_CONTEXT("Copy", "PresetName"), "PresetName"); diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 473f7e6e1..7d2879f0a 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -792,12 +792,12 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection* dependent_ wxColour bgr_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); SetBackgroundColour(bgr_clr); -#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT && defined(__WXMSW__) +#if defined(__WXMSW__) // ys_FIXME! temporary workaround for correct font scaling // Because of from wxWidgets 3.1.3 auto rescaling is implemented for the Fonts, // From the very beginning set dialog font to the wxSYS_DEFAULT_GUI_FONT this->SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); -#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT +#endif // __WXMSW__ int border = 10; int em = em_unit(); @@ -1375,12 +1375,12 @@ DiffPresetDialog::DiffPresetDialog(MainFrame* mainframe) wxColour bgr_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); SetBackgroundColour(bgr_clr); -#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT && defined(__WXMSW__) +#if defined(__WXMSW__) // ys_FIXME! temporary workaround for correct font scaling // Because of from wxWidgets 3.1.3 auto rescaling is implemented for the Fonts, // From the very beginning set dialog font to the wxSYS_DEFAULT_GUI_FONT this->SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); -#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT +#endif // __WXMSW__ int border = 10; int em = em_unit();