Button's border and background aren't use on MSW.

This commit is contained in:
YuSanka 2018-05-03 13:27:20 +02:00
parent 6abfee65ce
commit 993294579d

View file

@ -813,24 +813,24 @@ void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFl
wxCollapsiblePane *collpane = new wxCollapsiblePane(parent, wxID_ANY, "Print settings:");
collpane->Bind(wxEVT_COLLAPSIBLEPANE_CHANGED, ([parent, collpane](wxCommandEvent e){
wxWindowUpdateLocker noUpdates(parent);
parent->Layout();
collpane->Refresh();
}));
// add the pane with a zero proportion value to the sizer which contains it
sizer->Add(collpane, 0, wxGROW | wxALL, 5);
// now add a test label in the collapsible pane using a sizer to layout it:
sizer->Add(collpane, 0, wxGROW | wxALL, 0);
wxWindow *win = collpane->GetPane();
#ifdef __WXMSW__
collpane->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
win->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
wxColour& clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
collpane->GetControlWidget()->SetWindowStyleFlag(wxNO_BORDER);
collpane->GetControlWidget()->SetBackgroundColour(clr);
collpane->SetBackgroundColour(clr);
win->SetBackgroundColour(clr);
#endif //__WXMSW__
DynamicPrintConfig* config = &g_PresetBundle->prints.get_edited_preset().config;
m_optgroup = std::make_shared<ConfigOptionsGroup>(/*parent*/win, "", config);
// const wxArrayInt& ar = preset_sizer->GetColWidths();
// m_optgroup->label_width = ar.IsEmpty() ? 100 : ar.front(); // doesn't work
m_optgroup = std::make_shared<ConfigOptionsGroup>(win, "", config);
m_optgroup->m_on_change = [config](t_config_option_key opt_key, boost::any value){
TabPrint* tab_print = nullptr;
for (size_t i = 0; i < g_wxTabPanel->GetPageCount(); ++i) {
@ -943,10 +943,6 @@ void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFl
m_optgroup->append_line(line);
// sizer->Add(m_optgroup->sizer, 1, wxEXPAND | wxBOTTOM, 2);
wxSizer *paneSz = new wxBoxSizer(wxVERTICAL);
paneSz->Add(m_optgroup->sizer, 1, wxGROW | wxEXPAND | wxBOTTOM, 2);
win->SetSizer(paneSz);