FIX: Support dark mode in filament picker

- Applied dark theme styling to filament picker dialog
- Fixed color picker background not updating on theme switch

jira: STUDIO-12935

Change-Id: I9c7dcc518e7b0bd2c330f477ee42f4c61ea9fd4b
(cherry picked from commit 66ae7a02b945ff603b2dc699c93e55589481379e)
This commit is contained in:
fei2.fang
2025-06-29 17:57:05 +08:00
committed by Noisyfox
parent 9ee76e4775
commit 470ed6af5d
6 changed files with 46 additions and 11 deletions

View File

@@ -823,6 +823,7 @@ PlaterPresetComboBox::PlaterPresetComboBox(wxWindow *parent, Preset::Type preset
if (m_type == Preset::TYPE_FILAMENT) {
int em = wxGetApp().em_unit();
clr_picker = new wxBitmapButton(parent, wxID_ANY, {}, wxDefaultPosition, wxSize(FromDIP(20), FromDIP(20)), wxBU_EXACTFIT | wxBU_AUTODRAW | wxBORDER_NONE);
clr_picker->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
clr_picker->SetToolTip(_L("Click to select filament color"));
clr_picker->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
m_clrData.SetColour(clr_picker->GetBackgroundColour());
@@ -1744,8 +1745,7 @@ void TabPresetComboBox::update_dirty()
GUI::CalibrateFilamentComboBox::CalibrateFilamentComboBox(wxWindow *parent)
: PlaterPresetComboBox(parent, Preset::TYPE_FILAMENT)
{
clr_picker->SetBackgroundColour(*wxWHITE);
clr_picker->SetBitmap(*get_extruder_color_icon("#FFFFFFFF", "", FromDIP(20), FromDIP(20)));
clr_picker->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
clr_picker->SetToolTip("");
clr_picker->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {});
}
@@ -1936,4 +1936,11 @@ void GUI::CalibrateFilamentComboBox::OnSelect(wxCommandEvent &evt)
wxPostEvent(m_parent, e);
}
void PlaterPresetComboBox::sys_color_changed()
{
PresetComboBox::sys_color_changed();
if (clr_picker) {
clr_picker->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
}
}
} // namespace Slic3r