Fix dark-theme backgrounds across device, HMS, and AMS UI on macOS

Give previously-bare panels a keyed background so the existing dark-UI walk
can theme them. Runtime-created widgets (HMS items, device firmware/nozzle
panels) route their whole subtree through one UpdateDarkUIWin(this) call
instead of per-widget darkModeColorFor, which also themes their child text
and follows live light/dark switches. Extruder-card chips re-apply their
colours from Sidebar::sys_color_changed so a live switch updates them too.
This commit is contained in:
SoftFever
2026-07-19 20:16:17 +08:00
parent bd854c5ce5
commit f7f0c82abb
9 changed files with 80 additions and 26 deletions

View File

@@ -8,6 +8,7 @@
#include "uiDeviceUpdateVersion.h"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/wxExtensions.hpp"
#include "slic3r/GUI/Widgets/Label.hpp" // Orca: explicit Label include
@@ -27,6 +28,7 @@ uiDeviceUpdateVersion::uiDeviceUpdateVersion(wxWindow* parent,
long style /*= wxTAB_TRAVERSAL*/)
: wxPanel(parent, id, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
CreateWidgets();
}
@@ -110,4 +112,6 @@ void uiDeviceUpdateVersion::CreateWidgets()
SetSizer(main_sizer);
Layout();
wxGetApp().UpdateDarkUIWin(this);
}

View File

@@ -257,7 +257,9 @@ void wgtDeviceNozzleRackArea::CreateGui()
wxSizer* content_sizer = new wxBoxSizer(wxVERTICAL);
m_panel_content = new wxPanel(m_simple_book, wxID_ANY);
m_panel_content->SetBackgroundColour(*wxWHITE);
m_panel_refresh = new wxPanel(m_simple_book, wxID_ANY);
m_panel_refresh->SetBackgroundColour(*wxWHITE);
// Create Hotends ans Rack Position Panel
wxSizer* hotends_rack_sizer = new wxBoxSizer(wxHORIZONTAL);

View File

@@ -188,6 +188,7 @@ void wgtDeviceNozzleRackHotendUpdate::CreateGui()
// Icon
wxPanel* imagePanel = new wxPanel(this);
imagePanel->SetBackgroundColour(WGT_DEVICE_NOZZLE_RACK_HOTEND_UPDATE_DEFAULT_BG);
imagePanel->SetMaxSize(WX_DIP_SIZE(46, -1));
imagePanel->SetMinSize(WX_DIP_SIZE(46, -1));
imagePanel->SetSize(wxSize(FromDIP(46), FromDIP(-1)));
@@ -203,6 +204,7 @@ void wgtDeviceNozzleRackHotendUpdate::CreateGui()
// Diameter/type (vertical)
wxPanel* type_panel = new wxPanel(this);
type_panel->SetBackgroundColour(WGT_DEVICE_NOZZLE_RACK_HOTEND_UPDATE_DEFAULT_BG);
auto* main_type_sizer = new wxBoxSizer(wxVERTICAL);
auto* type_sizer_row_1 = new wxBoxSizer(wxHORIZONTAL);
auto* type_sizer_row_2 = new wxBoxSizer(wxHORIZONTAL);
@@ -251,6 +253,7 @@ void wgtDeviceNozzleRackHotendUpdate::CreateGui()
// SN and version (vertical)
wxPanel* info_panel = new wxPanel(this);
info_panel->SetBackgroundColour(WGT_DEVICE_NOZZLE_RACK_HOTEND_UPDATE_DEFAULT_BG);
auto* info_sizer = new wxBoxSizer(wxVERTICAL);
m_sn_label = new Label(info_panel);
m_sn_label->SetFont(Label::Body_12);

View File

@@ -9,6 +9,7 @@
#include "wgtDeviceNozzleRack.h"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/DeviceTab/wgtMsgBox.h"
#include "slic3r/GUI/Widgets/Label.hpp" // Orca: explicit Label include
@@ -28,6 +29,7 @@ wgtDeviceNozzleRackSelect::wgtDeviceNozzleRackSelect(wxWindow *parent) : wxPanel
static wxPanel* s_create_title(wxWindow *parent, const wxString& text)
{
wxPanel *panel = new wxPanel(parent, wxID_ANY);
panel->SetBackgroundColour(*wxWHITE);
auto title = new Label(panel, text);
title->SetFont(::Label::Body_13);
@@ -35,7 +37,7 @@ static wxPanel* s_create_title(wxWindow *parent, const wxString& text)
title->SetForegroundColour(0x909090);
auto split_line = new wxPanel(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
split_line->SetBackgroundColour(0xeeeeee);
split_line->SetBackgroundColour(wxColour(0xEE, 0xEE, 0xEE));
split_line->SetMinSize(wxSize(-1, 1));
split_line->SetMaxSize(wxSize(-1, 1));
@@ -104,6 +106,8 @@ void wgtDeviceNozzleRackSelect::CreateGui()
SetSizer(main_sizer);
Layout();
Fit();
wxGetApp().UpdateDarkUIWin(this);
}
static void s_update_nozzle_info(wgtDeviceNozzleRackNozzleItem* item,