ENH:wxStaticText set the default foreground colour

Change-Id: Ifb03554848bc869f8605fb10945e7681147204d5
This commit is contained in:
tao wang 2022-12-21 11:58:15 +08:00 committed by Lane.Wei
parent 64a635608c
commit 4d8d4cb69c
13 changed files with 29 additions and 0 deletions

View File

@ -177,6 +177,7 @@ void AMSMaterialsSetting::create()
m_sizer_SN_inside->Add(0, 0, 0, wxEXPAND, 0);
m_sn_number = new wxStaticText(m_panel_SN, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize);
m_sn_number->SetForegroundColour(*wxBLACK);
m_sizer_SN_inside->Add(m_sn_number, 0, wxALIGN_CENTER, 0);
m_sizer_SN->Add(m_sizer_SN_inside);
@ -186,6 +187,7 @@ void AMSMaterialsSetting::create()
wxBoxSizer* m_tip_sizer = new wxBoxSizer(wxHORIZONTAL);
m_tip_readonly = new wxStaticText(this, wxID_ANY, _L("Setting AMS slot information while printing is not supported"), wxDefaultPosition, wxSize(-1, AMS_MATERIALS_SETTING_INPUT_SIZE.y));
m_tip_readonly->SetForegroundColour(*wxBLACK);
m_tip_readonly->Hide();
m_tip_sizer->Add(m_tip_readonly, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20));

View File

@ -382,6 +382,7 @@ wxString AMSSetting::append_title(wxString text)
{
wxString lab;
auto * widget = new wxStaticText(m_panel_body, wxID_ANY, text, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
widget->SetForegroundColour(*wxBLACK);
widget->Wrap(AMS_SETTING_BODY_WIDTH);
widget->SetMinSize(wxSize(AMS_SETTING_BODY_WIDTH, -1));
lab = widget->GetLabel();

View File

@ -612,6 +612,7 @@ AmsMapingTipPopup::AmsMapingTipPopup(wxWindow *parent)
wxBoxSizer *sizer_enable_ams = new wxBoxSizer(wxVERTICAL);
m_title_enable_ams = new wxStaticText(m_panel_enable_ams, wxID_ANY, _L("Enable AMS"), wxDefaultPosition, wxDefaultSize, 0);
m_title_enable_ams->SetForegroundColour(*wxBLACK);
m_title_enable_ams->SetBackgroundColour(*wxWHITE);
m_title_enable_ams->Wrap(-1);
sizer_enable_ams->Add(m_title_enable_ams, 0, 0, 0);
@ -619,6 +620,7 @@ AmsMapingTipPopup::AmsMapingTipPopup(wxWindow *parent)
m_tip_enable_ams = new wxStaticText(m_panel_enable_ams, wxID_ANY, _L("Print with filaments in the AMS"), wxDefaultPosition, wxDefaultSize, 0);
m_tip_enable_ams->SetMinSize(wxSize(FromDIP(200), FromDIP(50)));
m_tip_enable_ams->Wrap(FromDIP(200));
m_tip_enable_ams->SetForegroundColour(*wxBLACK);
m_tip_enable_ams->SetBackgroundColour(*wxWHITE);
sizer_enable_ams->Add(m_tip_enable_ams, 0, wxTOP, 8);
@ -647,12 +649,14 @@ AmsMapingTipPopup::AmsMapingTipPopup(wxWindow *parent)
m_title_disable_ams = new wxStaticText(m_panel_disable_ams, wxID_ANY, _L("Disable AMS"), wxDefaultPosition, wxDefaultSize, 0);
m_title_disable_ams->SetBackgroundColour(*wxWHITE);
m_title_disable_ams->SetForegroundColour(*wxBLACK);
m_title_disable_ams->Wrap(-1);
sizer_disable_ams->Add(m_title_disable_ams, 0, 0, 0);
m_tip_disable_ams = new wxStaticText(m_panel_disable_ams, wxID_ANY, _L("Print with the filament mounted on the back of chassis"), wxDefaultPosition, wxDefaultSize, 0);
m_tip_disable_ams->SetMinSize(wxSize(FromDIP(200), FromDIP(50)));
m_tip_disable_ams->Wrap(FromDIP(200));
m_tip_disable_ams->SetForegroundColour(*wxBLACK);
m_tip_disable_ams->SetBackgroundColour(*wxWHITE);
sizer_disable_ams->Add(m_tip_disable_ams, 0, wxTOP, FromDIP(8));

View File

@ -1101,6 +1101,7 @@ void AuxiliaryPanel::update_all_cover()
auto m_text_designer = new wxStaticText(this, wxID_ANY, _L("Author"), wxDefaultPosition, wxSize(120, -1), 0);
m_text_designer->Wrap(-1);
m_text_designer->SetForegroundColour(*wxBLACK);
m_sizer_designer->Add(m_text_designer, 0, wxALIGN_CENTER, 0);
m_input_designer = new ::TextInput(this, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(450), FromDIP(30)), wxTE_PROCESS_ENTER);
@ -1111,6 +1112,7 @@ void AuxiliaryPanel::update_all_cover()
wxBoxSizer *m_sizer_model_name = new wxBoxSizer(wxHORIZONTAL);
auto m_text_model_name = new wxStaticText(this, wxID_ANY, _L("Model Name"), wxDefaultPosition, wxSize(120, -1), 0);
m_text_model_name->SetForegroundColour(*wxBLACK);
m_text_model_name->Wrap(-1);
m_sizer_model_name->Add(m_text_model_name, 0, wxALIGN_CENTER, 0);

View File

@ -31,8 +31,14 @@ BBLStatusBar::BBLStatusBar(wxWindow *parent, int id)
, m_object_info_sizer(new wxBoxSizer(wxHORIZONTAL))
{
m_status_text = new wxStaticText(m_self, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
m_status_text->SetForegroundColour(*wxBLACK);
m_object_info = new wxStaticText(m_self, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
m_object_info->SetForegroundColour(*wxBLACK);
m_slice_info = new wxStaticText(m_self, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
m_slice_info->SetForegroundColour(*wxBLACK);
wxStaticLine* seperator_1 = new wxStaticLine(m_self, wxID_ANY, wxDefaultPosition, wxSize(3, -1), wxLI_VERTICAL);
wxStaticLine* seperator_2 = new wxStaticLine(m_self, wxID_ANY, wxDefaultPosition, wxSize(3, -1), wxLI_VERTICAL);

View File

@ -41,6 +41,7 @@ namespace GUI {
m_printer_img->SetBackgroundColour(BIND_DIALOG_GREY200);
m_printer_img->Hide();
m_printer_name = new wxStaticText(m_panel_left, wxID_ANY, wxEmptyString);
m_printer_name->SetForegroundColour(*wxBLACK);
m_printer_name->SetBackgroundColour(BIND_DIALOG_GREY200);
m_printer_name->SetFont(::Label::Head_14);
m_sizere_left_v->Add(m_printer_img, 0, wxALIGN_CENTER, 0);
@ -317,6 +318,7 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
m_printer_img->Hide();
m_printer_name = new wxStaticText(m_panel_left, wxID_ANY, wxEmptyString);
m_printer_name->SetFont(::Label::Head_14);
m_printer_name->SetForegroundColour(*wxBLACK);
m_printer_name->SetBackgroundColour(BIND_DIALOG_GREY200);
m_sizere_left_v->Add(m_printer_img, 0, wxALIGN_CENTER, 0);
m_sizere_left_v->Add(0, 0, 0, wxTOP, 5);
@ -335,6 +337,7 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
m_panel_right->SetCornerRadius(FromDIP(8));
m_panel_right->SetBackgroundColor(BIND_DIALOG_GREY200);
m_user_name = new wxStaticText(m_panel_right, wxID_ANY, wxEmptyString);
m_user_name->SetForegroundColour(*wxBLACK);
m_user_name->SetBackgroundColour(BIND_DIALOG_GREY200);
m_user_name->SetFont(::Label::Head_14);
wxBoxSizer *m_sizer_right_h = new wxBoxSizer(wxHORIZONTAL);

View File

@ -161,6 +161,7 @@ wxWindow* CameraPopup::create_item_radiobox(wxString title, wxWindow* parent, wx
});
wxStaticText *text = new wxStaticText(item, wxID_ANY, title, wxDefaultPosition, wxDefaultSize);
text->SetForegroundColour(*wxBLACK);
resolution_texts.push_back(text);
text->SetPosition(wxPoint(padding_left + radiobox->GetSize().GetWidth() + 10, (item->GetSize().GetHeight() - text->GetSize().GetHeight()) / 2));
text->SetFont(Label::Body_13);

View File

@ -67,6 +67,7 @@ DownloadProgressDialog::DownloadProgressDialog(wxString title)
wxBoxSizer* sizer_download_failed = new wxBoxSizer(wxVERTICAL);
auto m_statictext_download_failed = new wxStaticText(m_panel_download_failed, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
m_statictext_download_failed->SetForegroundColour(*wxBLACK);
m_statictext_download_failed->SetLabel(format_text(m_statictext_download_failed, download_failed_msg, FromDIP(360)));
m_statictext_download_failed->Wrap(FromDIP(360));
@ -87,6 +88,7 @@ DownloadProgressDialog::DownloadProgressDialog(wxString title)
wxBoxSizer* sizer_install_failed = new wxBoxSizer(wxVERTICAL);
auto m_statictext_install_failed = new wxStaticText(m_panel_install_failed, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
m_statictext_install_failed->SetForegroundColour(*wxBLACK);
m_statictext_install_failed->SetLabel(format_text(m_statictext_install_failed, install_failed_msg,FromDIP(360)));
m_statictext_install_failed->Wrap(FromDIP(360));

View File

@ -31,6 +31,7 @@ HMSNotifyItem::HMSNotifyItem(wxWindow *parent, HMSItem& item)
m_bitmap_notify->SetBitmap(get_notify_bitmap());
m_hms_content = new wxStaticText(m_panel_hms, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
m_hms_content->SetForegroundColour(*wxBLACK);
m_hms_content->SetSize(HMS_NOTIFY_ITEM_TEXT_SIZE);
m_hms_content->SetMinSize(HMS_NOTIFY_ITEM_TEXT_SIZE);
m_hms_content->SetLabelText(_L(wxGetApp().get_hms_query()->query_hms_msg(m_hms_item.get_long_error_code())));

View File

@ -240,8 +240,10 @@ SlicedInfo::SlicedInfo(wxWindow *parent) :
auto init_info_label = [this, parent, grid_sizer](wxString text_label) {
auto *text = new wxStaticText(parent, wxID_ANY, text_label);
text->SetForegroundColour(*wxBLACK);
text->SetFont(wxGetApp().small_font());
auto info_label = new wxStaticText(parent, wxID_ANY, "N/A");
info_label->SetForegroundColour(*wxBLACK);
info_label->SetFont(wxGetApp().small_font());
grid_sizer->Add(text, 0);
grid_sizer->Add(info_label, 0);

View File

@ -90,6 +90,7 @@ void ReleaseNoteDialog::update_release_note(wxString release_note, std::string v
m_text_up_info->SetLabel(wxString::Format(_L("version %s update information :"), version));
wxBoxSizer * sizer_text_release_note = new wxBoxSizer(wxVERTICAL);
auto m_staticText_release_note = new wxStaticText(m_vebview_release_note, wxID_ANY, release_note, wxDefaultPosition, wxDefaultSize, 0);
m_staticText_release_note->SetForegroundColour(*wxBLACK);
m_staticText_release_note->Wrap(FromDIP(530));
sizer_text_release_note->Add(m_staticText_release_note, 0, wxALL, 5);
m_vebview_release_note->SetSizer(sizer_text_release_note);
@ -492,6 +493,7 @@ void UpdateVersionDialog::update_version_info(wxString release_note, wxString ve
m_text_up_info->SetLabel(wxString::Format(_L("Click to download new version in default browser: %s"), version));
wxBoxSizer* sizer_text_release_note = new wxBoxSizer(wxVERTICAL);
auto m_staticText_release_note = new wxStaticText(m_scrollwindows_release_note, wxID_ANY, release_note, wxDefaultPosition, wxDefaultSize, 0);
m_staticText_release_note->SetForegroundColour(*wxBLACK);
m_staticText_release_note->Wrap(FromDIP(530));
sizer_text_release_note->Add(m_staticText_release_note, 0, wxALL, 5);
m_scrollwindows_release_note->SetSizer(sizer_text_release_note);

View File

@ -250,6 +250,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
m_statictext_printer_msg = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
m_statictext_printer_msg->SetFont(::Label::Body_13);
m_statictext_printer_msg->SetForegroundColour(*wxBLACK);
m_statictext_printer_msg->Hide();
// line schedule
@ -337,6 +338,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
rename_sizer_h = new wxBoxSizer(wxHORIZONTAL);
m_rename_text = new wxStaticText(m_rename_normal_panel, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0);
m_rename_text->SetForegroundColour(*wxBLACK);
m_rename_text->SetFont(::Label::Body_13);
m_rename_text->SetMaxSize(wxSize(FromDIP(390), -1));
m_rename_button = new Button(m_rename_normal_panel, "", "ams_editable", wxBORDER_NONE, FromDIP(10));

View File

@ -225,6 +225,7 @@ Label::Label(wxWindow *parent, wxFont const &font, wxString const &text, long st
{
this->font = font;
SetFont(font);
SetForegroundColour(wxColour("#262E30"));
SetBackgroundColour(StaticBox::GetParentBackgroundColor(parent));
SetForegroundColour("#262E30");
if (style & LB_PROPAGATE_MOUSE_EVENT) {