Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2021-01-22 23:44:15 +0300
committerYuSanka <yusanka@gmail.com>2021-04-12 16:45:47 +0300
commit89b942ffb7a3a2f5368a387b359909900934b0d9 (patch)
tree57640f519764e4959fe3379029fa700a24cef93f
parent6a0e816d94a1dd71d1041742613bb0fd2d2dee71 (diff)
OSX specific, related to the wxWidgets 3.1.4: Fixed wrong UI-scaling
(wxWidgets 3.1.4 can binding of wxEVT_DPI_CHANGED now, so it was called msw_rescale() for most of the controls redundantly) + Fixed update of the DoubleSlider after changing of the system color
-rw-r--r--src/slic3r/GUI/DoubleSlider.cpp20
-rw-r--r--src/slic3r/GUI/DoubleSlider.hpp1
-rw-r--r--src/slic3r/GUI/GUI_Preview.cpp6
-rw-r--r--src/slic3r/GUI/GUI_Preview.hpp1
-rw-r--r--src/slic3r/GUI/GUI_Utils.hpp2
-rw-r--r--src/slic3r/GUI/OG_CustomCtrl.cpp4
-rw-r--r--src/slic3r/GUI/Plater.cpp1
7 files changed, 34 insertions, 1 deletions
diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp
index ee589c94a..1e4eed1e8 100644
--- a/src/slic3r/GUI/DoubleSlider.cpp
+++ b/src/slic3r/GUI/DoubleSlider.cpp
@@ -160,6 +160,26 @@ void Control::msw_rescale()
GetParent()->Layout();
}
+void Control::sys_color_changed()
+{
+ m_bmp_add_tick_on .msw_rescale();
+ m_bmp_add_tick_off.msw_rescale();
+ m_bmp_del_tick_on .msw_rescale();
+ m_bmp_del_tick_off.msw_rescale();
+ m_tick_icon_dim = m_bmp_add_tick_on.GetBmpWidth();
+
+ m_bmp_one_layer_lock_on .msw_rescale();
+ m_bmp_one_layer_lock_off .msw_rescale();
+ m_bmp_one_layer_unlock_on .msw_rescale();
+ m_bmp_one_layer_unlock_off.msw_rescale();
+ m_lock_icon_dim = m_bmp_one_layer_lock_on.GetBmpWidth();
+
+ m_bmp_revert.msw_rescale();
+ m_revert_icon_dim = m_bmp_revert.GetBmpWidth();
+ m_bmp_cog.msw_rescale();
+ m_cog_icon_dim = m_bmp_cog.GetBmpWidth();
+}
+
int Control::GetActiveValue() const
{
return m_selection == ssLower ?
diff --git a/src/slic3r/GUI/DoubleSlider.hpp b/src/slic3r/GUI/DoubleSlider.hpp
index 56baef6cf..0d90367c0 100644
--- a/src/slic3r/GUI/DoubleSlider.hpp
+++ b/src/slic3r/GUI/DoubleSlider.hpp
@@ -192,6 +192,7 @@ public:
~Control() {}
void msw_rescale();
+ void sys_color_changed();
int GetMinValue() const { return m_min_value; }
int GetMaxValue() const { return m_max_value; }
diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp
index e301a9c3e..50e451830 100644
--- a/src/slic3r/GUI/GUI_Preview.cpp
+++ b/src/slic3r/GUI/GUI_Preview.cpp
@@ -413,6 +413,12 @@ void Preview::msw_rescale()
refresh_print();
}
+void Preview::sys_color_changed()
+{
+ if (m_layers_slider != nullptr)
+ m_layers_slider->sys_color_changed();
+}
+
void Preview::jump_layers_slider(wxKeyEvent& evt)
{
if (m_layers_slider) m_layers_slider->OnChar(evt);
diff --git a/src/slic3r/GUI/GUI_Preview.hpp b/src/slic3r/GUI/GUI_Preview.hpp
index 0060bfcff..372d44fa3 100644
--- a/src/slic3r/GUI/GUI_Preview.hpp
+++ b/src/slic3r/GUI/GUI_Preview.hpp
@@ -150,6 +150,7 @@ public:
void refresh_print();
void msw_rescale();
+ void sys_color_changed();
void jump_layers_slider(wxKeyEvent& evt);
void move_layers_slider(wxKeyEvent& evt);
void edit_layers_slider(wxKeyEvent& evt);
diff --git a/src/slic3r/GUI/GUI_Utils.hpp b/src/slic3r/GUI/GUI_Utils.hpp
index 3235d6e9e..dbb200f83 100644
--- a/src/slic3r/GUI/GUI_Utils.hpp
+++ b/src/slic3r/GUI/GUI_Utils.hpp
@@ -108,6 +108,7 @@ public:
// recalc_font();
+#ifndef __WXOSX__
#if wxVERSION_EQUAL_OR_GREATER_THAN(3,1,3)
this->Bind(wxEVT_DPI_CHANGED, [this](wxDPIChangedEvent& evt) {
m_scale_factor = (float)evt.GetNewDPI().x / (float)DPI_DEFAULT;
@@ -128,6 +129,7 @@ public:
rescale(evt.rect);
});
#endif // wxVERSION_EQUAL_OR_GREATER_THAN
+#endif // no __WXOSX__
this->Bind(wxEVT_MOVE_START, [this](wxMoveEvent& event)
{
diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp
index 07b96755d..1e581e70b 100644
--- a/src/slic3r/GUI/OG_CustomCtrl.cpp
+++ b/src/slic3r/GUI/OG_CustomCtrl.cpp
@@ -360,6 +360,9 @@ void OG_CustomCtrl::correct_widgets_position(wxSizer* widget, const Line& line,
void OG_CustomCtrl::msw_rescale()
{
+#ifdef __WXOSX__
+ return;
+#endif
m_font = wxGetApp().normal_font();
m_em_unit = em_unit(m_parent);
m_v_gap = lround(1.0 * m_em_unit);
@@ -381,7 +384,6 @@ void OG_CustomCtrl::msw_rescale()
void OG_CustomCtrl::sys_color_changed()
{
- msw_rescale();
}
OG_CustomCtrl::CtrlLine::CtrlLine( wxCoord height,
diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp
index af36bf7d3..e154c0567 100644
--- a/src/slic3r/GUI/Plater.cpp
+++ b/src/slic3r/GUI/Plater.cpp
@@ -6203,6 +6203,7 @@ void Plater::msw_rescale()
void Plater::sys_color_changed()
{
+ p->preview->sys_color_changed();
p->sidebar->sys_color_changed();
// msw_rescale_menu updates just icons, so use it