Fix for #7012 - Dark mode + colored axis: Can't read the Manipulation panel

This commit is contained in:
YuSanka 2021-10-04 13:57:01 +02:00
parent 39a98e97b4
commit a5a6c0e09a

View file

@ -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()