diff options
author | Lukas Matena <lukasmatena@seznam.cz> | 2022-03-04 11:50:38 +0300 |
---|---|---|
committer | Lukas Matena <lukasmatena@seznam.cz> | 2022-03-07 18:43:21 +0300 |
commit | 62cc48188d36b2afe9b2085d84b76e6f25e95602 (patch) | |
tree | 161dbefa7bca4fc656e56ccc312638ca36bc28b1 | |
parent | ea88d0b0ae276495cea7dee1e70f19e4bcc1d903 (diff) |
Fix background color in InfoDialog on older macOSes (#3775, #7603)
-rw-r--r-- | src/slic3r/GUI/MsgDialog.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index 31d137cb6..90ed27467 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -137,7 +137,22 @@ static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxStrin wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxFont monospace = wxGetApp().code_font(); wxColour text_clr = wxGetApp().get_label_clr_default(); - wxColour bgr_clr = parent->GetBackgroundColour(); //wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); + wxColour bgr_clr = parent->GetBackgroundColour(); + +#ifdef __APPLE__ + // On macOS 10.13 and older the background color returned by wxWidgets + // is wrong, which leads to https://github.com/prusa3d/PrusaSlicer/issues/7603 + // and https://github.com/prusa3d/PrusaSlicer/issues/3775. wxSYS_COLOUR_WINDOW + // may not match the window background exactly, but it seems to never end up + // as black on black. + + if (wxPlatformInfo::Get().GetOSMajorVersion() == 10 + && wxPlatformInfo::Get().GetOSMinorVersion() < 14) + bgr_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); +#endif + + + auto text_clr_str = wxString::Format(wxT("#%02X%02X%02X"), text_clr.Red(), text_clr.Green(), text_clr.Blue()); auto bgr_clr_str = wxString::Format(wxT("#%02X%02X%02X"), bgr_clr.Red(), bgr_clr.Green(), bgr_clr.Blue()); const int font_size = font.GetPointSize(); |