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:
authorLukas Matena <lukasmatena@seznam.cz>2022-03-04 11:50:38 +0300
committerLukas Matena <lukasmatena@seznam.cz>2022-03-07 18:43:21 +0300
commit62cc48188d36b2afe9b2085d84b76e6f25e95602 (patch)
tree161dbefa7bca4fc656e56ccc312638ca36bc28b1
parentea88d0b0ae276495cea7dee1e70f19e4bcc1d903 (diff)
Fix background color in InfoDialog on older macOSes (#3775, #7603)
-rw-r--r--src/slic3r/GUI/MsgDialog.cpp17
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();