FIX: background color of title labels in sidebar

Change-Id: If71fdca36518129cdfdd1cdf939fb62592ec56c1
This commit is contained in:
chunmao.guo 2022-08-09 17:33:13 +08:00 committed by Lane.Wei
parent 21d13646d8
commit 43cd7c8315
6 changed files with 12 additions and 23 deletions

View File

@ -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(); });

View File

@ -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

View File

@ -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);

View File

@ -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<TabPrint*>(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) {

View File

@ -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));
}

View File

@ -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;