From a5a6c0e09aff7fc9c454d55978db051f49ecd89d Mon Sep 17 00:00:00 2001 From: YuSanka <yusanka@gmail.com> Date: Mon, 4 Oct 2021 13:57:01 +0200 Subject: [PATCH] Fix for #7012 - Dark mode + colored axis: Can't read the Manipulation panel --- src/slic3r/GUI/GUI_ObjectManipulation.cpp | 28 +++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp index 6eaa6316d..7d5f80a30 100644 --- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp +++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp @@ -497,14 +497,19 @@ void ObjectManipulation::update_ui_from_settings() int axis_id = 0; for (ManipulationEditor* editor : m_editors) { // editor->SetForegroundColour(m_use_colors ? wxColour(axes_color_text[axis_id]) : wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); -#ifdef _WIN32 - if (m_use_colors) + if (m_use_colors) { editor->SetBackgroundColour(wxColour(axes_color_back[axis_id])); - else + if (wxGetApp().dark_mode()) + editor->SetForegroundColour(*wxBLACK); + } + else { +#ifdef _WIN32 wxGetApp().UpdateDarkUI(editor); #else - editor->SetBackgroundColour(m_use_colors ? wxColour(axes_color_back[axis_id]) : wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); + editor->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); + editor->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); #endif /* _WIN32 */ + } editor->Refresh(); if (++axis_id == 3) axis_id = 0; @@ -1009,10 +1014,10 @@ void ObjectManipulation::sys_color_changed() get_og()->sys_color_changed(); wxGetApp().UpdateDarkUI(m_word_local_combo); wxGetApp().UpdateDarkUI(m_check_inch); - +#endif for (ManipulationEditor* editor : m_editors) editor->sys_color_changed(this); -#endif + // btn...->msw_rescale() updates icon on button, so use it m_mirror_bitmap_on.msw_rescale(); m_mirror_bitmap_off.msw_rescale(); @@ -1045,6 +1050,7 @@ ManipulationEditor::ManipulationEditor(ObjectManipulation* parent, #endif // __WXOSX__ if (parent->use_colors()) { this->SetBackgroundColour(wxColour(axes_color_back[axis])); + this->SetForegroundColour(*wxBLACK); } else { wxGetApp().UpdateDarkUI(this); } @@ -1097,10 +1103,14 @@ void ManipulationEditor::msw_rescale() void ManipulationEditor::sys_color_changed(ObjectManipulation* parent) { - if (!parent->use_colors()) - wxGetApp().UpdateDarkUI(this); - else + if (parent->use_colors()) SetForegroundColour(*wxBLACK); + else +#ifdef _WIN32 + wxGetApp().UpdateDarkUI(this); +#else + SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); +#endif // _WIN32 } double ManipulationEditor::get_value()