diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index 7218dcb0e..4fa726013 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -18,7 +18,7 @@ MediaPlayCtrl::MediaPlayCtrl(wxWindow *parent, wxMediaCtrl2 *media_ctrl, const w m_button_play = new Button(this, "", "media_play", wxBORDER_NONE); - m_label_status = new Label(Label::Body_14, this); + m_label_status = new Label(this); m_button_play->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](auto & e) { TogglePlay(); }); diff --git a/src/slic3r/GUI/ParamsPanel.cpp b/src/slic3r/GUI/ParamsPanel.cpp index 13574f3f4..8f1c3ac01 100644 --- a/src/slic3r/GUI/ParamsPanel.cpp +++ b/src/slic3r/GUI/ParamsPanel.cpp @@ -210,8 +210,7 @@ ParamsPanel::ParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, c m_process_icon = new ScalableButton(m_top_panel, wxID_ANY, "process"); - m_title_label = new Label(Label::Body_14, _L("Process"), m_top_panel); - m_title_label->Wrap( -1 ); + m_title_label = new Label(m_top_panel, _L("Process")); //int width, height; // BBS: new layout @@ -222,8 +221,7 @@ ParamsPanel::ParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, c m_tips_arrow = new wxStaticBitmap(m_top_panel, wxID_ANY, m_tips_arrow_icon); m_tips_arrow->Hide(); - m_title_view = new Label(Label::Body_14, _L("Advance"), m_top_panel); - m_title_view->Wrap( -1 ); + m_title_view = new Label(m_top_panel, _L("Advance")); m_mode_view = new SwitchButton(m_top_panel, wxID_ABOUT); // BBS: new layout diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 06d49d9be..8f0284bba 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -448,10 +448,7 @@ Sidebar::Sidebar(Plater *parent) p->m_panel_printer_title->SetBackgroundColor2(0xF1F1F1); p->m_printer_icon = new ScalableButton(p->m_panel_printer_title, wxID_ANY, "printer"); - p->m_text_printer_settings = new wxStaticText(p->m_panel_printer_title, wxID_ANY, _L("Printer"), wxDefaultPosition, wxDefaultSize, 0); - p->m_text_printer_settings->Wrap(-1); - p->m_text_printer_settings->SetFont(Label::Body_14); - p->m_text_printer_settings->SetBackgroundColour(0xF1F1F1); + p->m_text_printer_settings = new Label(p->m_panel_printer_title, _L("Printer")); p->m_printer_setting = new ScalableButton(p->m_panel_printer_title, wxID_ANY, "settings"); p->m_printer_setting->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { @@ -543,10 +540,7 @@ Sidebar::Sidebar(Plater *parent) wxBoxSizer* bSizer39; bSizer39 = new wxBoxSizer( wxHORIZONTAL ); p->m_filament_icon = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "filament"); - p->m_staticText_filament_settings = new wxStaticText( p->m_panel_filament_title, wxID_ANY, _L("Filament"), wxDefaultPosition, wxDefaultSize, 0 ); - p->m_staticText_filament_settings->Wrap( -1 ); - p->m_staticText_filament_settings->SetFont(Label::Body_14); - p->m_staticText_filament_settings->SetBackgroundColour(0xF1F1F1); + p->m_staticText_filament_settings = new Label(p->m_panel_filament_title, _L("Filament")); bSizer39->Add(p->m_filament_icon, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, FromDIP(10)); bSizer39->Add( p->m_staticText_filament_settings, 0, wxALIGN_CENTER ); bSizer39->Add(FromDIP(10), 0, 0, 0, 0); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 925a7ae6a..9e43fb6dc 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -352,7 +352,7 @@ void Tab::create_preset_tab() m_top_sizer->Add( m_search_item, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT , 8 ); if (dynamic_cast(this) == nullptr) { - m_static_title = new Label(Label::Body_12, _L("Advance"), m_top_panel); + m_static_title = new Label(m_top_panel, Label::Body_12, _L("Advance")); m_static_title->Wrap( -1 ); // BBS: open this tab by select first m_static_title->Bind(wxEVT_LEFT_UP, [this](auto& e) { diff --git a/src/slic3r/GUI/Widgets/Label.cpp b/src/slic3r/GUI/Widgets/Label.cpp index 6f7d1b976..93ec8c2a9 100644 --- a/src/slic3r/GUI/Widgets/Label.cpp +++ b/src/slic3r/GUI/Widgets/Label.cpp @@ -63,12 +63,11 @@ wxSize Label::split_lines(wxDC &dc, int width, const wxString &text, wxString &m return dc.GetMultiLineTextExtent(multiline_text); } -Label::Label(wxString const &text, wxWindow *parent) : Label(Body_16, text, parent) {} +Label::Label(wxWindow *parent, wxString const &text) : Label(parent, Body_14, text) {} -Label::Label(wxFont const &font, wxWindow *parent) : Label(font, "", parent) {} - -Label::Label(wxFont const &font, wxString const &text, wxWindow *parent) : wxStaticText(parent, wxID_ANY, text, wxDefaultPosition, wxDefaultSize, 0) +Label::Label(wxWindow *parent, wxFont const &font, wxString const &text) + : wxStaticText(parent, wxID_ANY, text, wxDefaultPosition, wxDefaultSize, 0) { - SetBackgroundColour(StaticBox::GetParentBackgroundColor(parent)); SetFont(font); + SetBackgroundColour(StaticBox::GetParentBackgroundColor(parent)); } diff --git a/src/slic3r/GUI/Widgets/Label.hpp b/src/slic3r/GUI/Widgets/Label.hpp index c1ffe913d..d82451ee8 100644 --- a/src/slic3r/GUI/Widgets/Label.hpp +++ b/src/slic3r/GUI/Widgets/Label.hpp @@ -6,11 +6,9 @@ class Label : public wxStaticText { public: - Label(wxString const& text, wxWindow* parent = NULL); + Label(wxWindow *parent, wxString const &text = {}); - Label(wxFont const& font, wxWindow* parent = NULL); - - Label(wxFont const& font, wxString const& text, wxWindow* parent = NULL); + Label(wxWindow *parent, wxFont const &font, wxString const &text = {}); public: static wxFont Head_24;