From 466e17ea88a11183cc1c9a2fcad9c899884031d2 Mon Sep 17 00:00:00 2001 From: tao wang Date: Fri, 7 Apr 2023 19:20:02 +0800 Subject: [PATCH] FIX:fixed color picker display error in dark mode Change-Id: Id31d19d33f7ced0a89b5bc61b0d913554dc38be2 --- src/slic3r/GUI/AMSMaterialsSetting.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp index d38278712..aeb75e212 100644 --- a/src/slic3r/GUI/AMSMaterialsSetting.cpp +++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp @@ -1046,7 +1046,7 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent) wxBoxSizer* m_sizer_ams = new wxBoxSizer(wxHORIZONTAL); auto m_title_ams = new wxStaticText(m_def_color_box, wxID_ANY, _L("AMS"), wxDefaultPosition, wxDefaultSize, 0); m_title_ams->SetFont(::Label::Body_14); - m_title_ams->SetBackgroundColour(GetParent()->GetBackgroundColour()); + m_title_ams->SetBackgroundColour(wxColour(238, 238, 238)); m_sizer_ams->Add(m_title_ams, 0, wxALL, 5); auto ams_line = new wxPanel(m_def_color_box, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL); ams_line->SetBackgroundColour(wxColour(0xCECECE)); @@ -1075,6 +1075,7 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent) auto cp = new ColorPicker(m_def_color_box, wxID_ANY, wxDefaultPosition, wxDefaultSize); cp->set_color(col); cp->set_selected(false); + cp->SetBackgroundColour(wxColour(238, 238, 238)); m_color_pickers.push_back(cp); fg_sizer->Add(cp, 0, wxALL, FromDIP(3)); cp->Bind(wxEVT_LEFT_DOWN, [this, cp](auto& e) { @@ -1090,7 +1091,7 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent) wxBoxSizer* m_sizer_other = new wxBoxSizer(wxHORIZONTAL); auto m_title_other = new wxStaticText(m_def_color_box, wxID_ANY, _L("Other color"), wxDefaultPosition, wxDefaultSize, 0); m_title_other->SetFont(::Label::Body_14); - m_title_other->SetBackgroundColour(GetParent()->GetBackgroundColour()); + m_title_other->SetBackgroundColour(wxColour(238, 238, 238)); m_sizer_other->Add(m_title_other, 0, wxALL, 5); auto other_line = new wxPanel(m_def_color_box, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL); other_line->SetMinSize(wxSize(-1, 1)); @@ -1141,6 +1142,7 @@ void ColorPickerPopup::set_ams_colours(std::vector ams) auto cp = new ColorPicker(m_def_color_box, wxID_ANY, wxDefaultPosition, wxDefaultSize); cp->set_color(col); cp->set_selected(false); + cp->SetBackgroundColour(StateColor::darkModeColorFor(wxColour(238,238,238))); m_color_pickers.push_back(cp); m_ams_color_pickers.push_back(cp); m_ams_fg_sizer->Add(cp, 0, wxALL, FromDIP(3));