From 8a22fab6d73fe2694b5006712d5e72619ddea51c Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Fri, 23 May 2025 09:59:23 +0800 Subject: [PATCH] FIX:WxColour (0x00AE42) represents bgr input, incorrect use jira: STUDIO-12347 Change-Id: If03e23f2ee7cbb5dcb124453fb0a1ea67c3633a0 --- src/slic3r/GUI/BBLStatusBarPrint.cpp | 2 +- src/slic3r/GUI/BindDialog.cpp | 6 +++--- .../GUI/CalibrationWizardPresetPage.cpp | 10 +++++---- src/slic3r/GUI/Plater.cpp | 21 +++++++++---------- src/slic3r/GUI/SelectMachine.cpp | 4 ++-- src/slic3r/GUI/SyncAmsInfoDialog.cpp | 2 +- src/slic3r/GUI/Widgets/FanControl.cpp | 2 +- src/slic3r/GUI/Widgets/TabCtrl.cpp | 2 +- 8 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/slic3r/GUI/BBLStatusBarPrint.cpp b/src/slic3r/GUI/BBLStatusBarPrint.cpp index 6d1c40a7a..bce43e879 100644 --- a/src/slic3r/GUI/BBLStatusBarPrint.cpp +++ b/src/slic3r/GUI/BBLStatusBarPrint.cpp @@ -71,7 +71,7 @@ BBLStatusBarPrint::BBLStatusBarPrint(wxWindow *parent, int id) m_sizer_status_text = new wxBoxSizer(wxHORIZONTAL); m_link_show_error = new Label(top_panel, _L("Check the reason")); - m_link_show_error->SetForegroundColour(wxColour(0x00ae42)); + m_link_show_error->SetForegroundColour(wxColour("#00AE42")); m_link_show_error->SetFont(::Label::Head_13); m_link_show_error->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) { this->m_self->SetCursor(wxCURSOR_HAND); }); m_link_show_error->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { this->m_self->SetCursor(wxCURSOR_ARROW); }); diff --git a/src/slic3r/GUI/BindDialog.cpp b/src/slic3r/GUI/BindDialog.cpp index 631de921a..fbe6487db 100644 --- a/src/slic3r/GUI/BindDialog.cpp +++ b/src/slic3r/GUI/BindDialog.cpp @@ -480,7 +480,7 @@ PingCodeBindDialog::~PingCodeBindDialog() { m_link_Terms_title->SetFont(Label::Head_13); m_link_Terms_title->SetMaxSize(wxSize(FromDIP(450), -1)); m_link_Terms_title->Wrap(FromDIP(450)); - m_link_Terms_title->SetForegroundColour(wxColour(0x00AE42)); + m_link_Terms_title->SetForegroundColour(wxColour("#00AE42")); m_link_Terms_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { wxString txt = _L("Thank you for purchasing a Bambu Lab device.Before using your Bambu Lab device, please read the termsand conditions.By clicking to agree to use your Bambu Lab device, you agree to abide by the Privacy Policy and Terms of Use(collectively, the \"Terms\"). If you do not comply with or agree to the Bambu Lab Privacy Policy, please do not use Bambu Lab equipment and services."); ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Terms and Conditions"), ConfirmBeforeSendDialog::ButtonStyle::ONLY_CONFIRM); @@ -499,7 +499,7 @@ PingCodeBindDialog::~PingCodeBindDialog() { m_link_privacy_title->SetFont(Label::Head_13); m_link_privacy_title->SetMaxSize(wxSize(FromDIP(450), -1)); m_link_privacy_title->Wrap(FromDIP(450)); - m_link_privacy_title->SetForegroundColour(wxColour(0x00AE42)); + m_link_privacy_title->SetForegroundColour(wxColour("#00AE42")); m_link_privacy_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { std::string url; std::string country_code = Slic3r::GUI::wxGetApp().app_config->get_country_code(); @@ -539,7 +539,7 @@ PingCodeBindDialog::~PingCodeBindDialog() { m_link_notice_title->SetFont(Label::Head_13); m_link_notice_title->SetMaxSize(wxSize(FromDIP(450), -1)); m_link_notice_title->Wrap(FromDIP(450)); - m_link_notice_title->SetForegroundColour(wxColour(0x00AE42)); + m_link_notice_title->SetForegroundColour(wxColour("#0x00AE42")); m_link_notice_title->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); }); m_link_notice_title->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); }); m_link_notice_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { diff --git a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp index 5b38aa0d6..8b4ac8f26 100644 --- a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp +++ b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp @@ -563,10 +563,12 @@ void CalibrationPresetPage::create_selection_panel(wxWindow* parent) m_btn_sync = new Button(parent, "", "ams_nozzle_sync"); m_btn_sync->SetToolTip(_L("Synchronize nozzle and AMS information")); m_btn_sync->SetCornerRadius(8); - StateColor btn_sync_bg_col(std::pair(wxColour(0xCECECE), StateColor::Pressed), std::pair(wxColour(0xF8F8F8), StateColor::Hovered), - std::pair(wxColour(0xF8F8F8), StateColor::Normal)); - StateColor btn_sync_bd_col(std::pair(wxColour(0x00AE42), StateColor::Pressed), std::pair(wxColour(0x00AE42), StateColor::Hovered), - std::pair(wxColour(0xEEEEEE), StateColor::Normal)); + StateColor btn_sync_bg_col(std::pair(wxColour("#CECECE"), StateColor::Pressed), + std::pair(wxColour("#F8F8F8"), StateColor::Hovered), + std::pair(wxColour("#F8F8F8"), StateColor::Normal)); + StateColor btn_sync_bd_col(std::pair(wxColour("#00AE42"), StateColor::Pressed), + std::pair(wxColour("#00AE42"), StateColor::Hovered), + std::pair(wxColour("#EEEEEE"), StateColor::Normal)); m_btn_sync->SetBackgroundColor(btn_sync_bg_col); m_btn_sync->SetBorderColor(btn_sync_bd_col); m_btn_sync->SetCanFocus(false); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a42af61c6..9ecafa984 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -573,7 +573,7 @@ void Sidebar::priv::flush_printer_sync(bool restart) *counter_sync_printer = 6; timer_sync_printer->Start(500); } - btn_sync_printer->SetBackgroundColorNormal((*counter_sync_printer & 1) ? 0xF8F8F8 : 0x00AE42); + btn_sync_printer->SetBackgroundColorNormal((*counter_sync_printer & 1) ? "#F8F8F8" :"#00AE42"); if (--*counter_sync_printer <= 0) timer_sync_printer->Stop(); } @@ -1550,10 +1550,9 @@ Sidebar::Sidebar(Plater *parent) /*************************** 2. add printer content ************************/ p->m_panel_printer_content = new wxPanel(p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); p->m_panel_printer_content->SetBackgroundColour(wxColour(255, 255, 255)); - - StateColor panel_bd_col(std::pair(wxColour(0x00AE42), StateColor::Pressed), - std::pair(wxColour(0x00AE42), StateColor::Hovered), - std::pair(wxColour(0xEEEEEE), StateColor::Normal)); + StateColor panel_bd_col(std::pair(wxColour("#00AE42"), StateColor::Pressed), + std::pair(wxColour("#00AE42"), StateColor::Hovered), + std::pair(wxColour("#EEEEEE"), StateColor::Normal)); p->panel_printer_preset = new StaticBox(p->m_panel_printer_content); p->panel_printer_preset->SetCornerRadius(8); @@ -1692,13 +1691,13 @@ Sidebar::Sidebar(Plater *parent) btn_sync->SetToolTip(_L("Synchronize nozzle information and the number of AMS")); btn_sync->SetCornerRadius(8); StateColor btn_sync_bg_col( - std::pair(wxColour(0xCECECE), StateColor::Pressed), - std::pair(wxColour(0xF8F8F8), StateColor::Hovered), - std::pair(wxColour(0xF8F8F8), StateColor::Normal)); + std::pair(wxColour("#CECECE"), StateColor::Pressed), + std::pair(wxColour("#F8F8F8"), StateColor::Hovered), + std::pair(wxColour("#F8F8F8"), StateColor::Normal)); StateColor btn_sync_bd_col( - std::pair(wxColour(0x00AE42), StateColor::Pressed), - std::pair(wxColour(0x00AE42), StateColor::Hovered), - std::pair(wxColour(0xEEEEEE), StateColor::Normal)); + std::pair(wxColour("#00AE42"), StateColor::Pressed), + std::pair(wxColour("#00AE42"), StateColor::Hovered), + std::pair(wxColour("#EEEEEE"), StateColor::Normal)); btn_sync->SetBackgroundColor(btn_sync_bg_col); btn_sync->SetBorderColor(btn_sync_bd_col); btn_sync->SetCanFocus(false); diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 64d776c5c..e3ac162f7 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -325,7 +325,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater) m_sizer_autorefill = new wxBoxSizer(wxHORIZONTAL); m_ams_backup_tip = new Label(m_scroll_area, _L("Auto Refill")); m_ams_backup_tip->SetFont(::Label::Head_13); - m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42)); + m_ams_backup_tip->SetForegroundColour(wxColour("#00AE42")); m_ams_backup_tip->SetBackgroundColour(*wxWHITE); img_ams_backup = new wxStaticBitmap(m_scroll_area, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0); img_ams_backup->SetBackgroundColour(*wxWHITE); @@ -2393,7 +2393,7 @@ void SelectMachineDialog::save_option_vals(MachineObject *obj) { void SelectMachineDialog::Enable_Auto_Refill(bool enable) { if (enable) { - m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42)); + m_ams_backup_tip->SetForegroundColour(wxColour("#00AE42")); } else { m_ams_backup_tip->SetForegroundColour(wxColour(0x90, 0x90, 0x90)); diff --git a/src/slic3r/GUI/SyncAmsInfoDialog.cpp b/src/slic3r/GUI/SyncAmsInfoDialog.cpp index daac3d713..552113420 100644 --- a/src/slic3r/GUI/SyncAmsInfoDialog.cpp +++ b/src/slic3r/GUI/SyncAmsInfoDialog.cpp @@ -2025,7 +2025,7 @@ void SyncAmsInfoDialog::Enable_Auto_Refill(bool enable) { if (!m_ams_backup_tip) { return; } if (enable) { - m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42)); + m_ams_backup_tip->SetForegroundColour(wxColour("#00AE42")); } else { m_ams_backup_tip->SetForegroundColour(wxColour(0x90, 0x90, 0x90)); } diff --git a/src/slic3r/GUI/Widgets/FanControl.cpp b/src/slic3r/GUI/Widgets/FanControl.cpp index f75a7e7ac..fe54623fd 100644 --- a/src/slic3r/GUI/Widgets/FanControl.cpp +++ b/src/slic3r/GUI/Widgets/FanControl.cpp @@ -375,7 +375,7 @@ FanControlNew::FanControlNew(wxWindow *parent, const AirDuctData &fan_data, int sizer_control->Add(sizer_control_top, 0, wxEXPAND, 0); m_static_status_name = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END | wxALIGN_CENTER_HORIZONTAL); - m_static_status_name->SetForegroundColour(wxColour(0x00AE42)); + m_static_status_name->SetForegroundColour(wxColour("#00AE42")); m_static_status_name->SetBackgroundColour(wxColour(248, 248, 248)); m_static_status_name->SetFont(Label::Head_18); m_static_status_name->SetMinSize(wxSize(FromDIP(100), -1)); diff --git a/src/slic3r/GUI/Widgets/TabCtrl.cpp b/src/slic3r/GUI/Widgets/TabCtrl.cpp index bbc7f7aac..b9ed88596 100644 --- a/src/slic3r/GUI/Widgets/TabCtrl.cpp +++ b/src/slic3r/GUI/Widgets/TabCtrl.cpp @@ -305,7 +305,7 @@ void TabCtrl::doRender(wxDC& dc) #else dc.SetPen(wxPen(border_color.colorForStates(states), border_width)); dc.DrawLine(0, size.y - BS2, size.x, size.y - BS2); - wxColor c(0x42AE00); + wxColour c("#00AE42"); dc.SetPen(wxPen(c, 1)); dc.SetBrush(c); dc.DrawRoundedRectangle(x1 - radius, size.y - BS2 - border_width * 3, x2 + radius * 2 - x1, border_width * 3, radius);