diff options
author | YuSanka <yusanka@gmail.com> | 2019-04-25 00:09:50 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2019-04-25 00:09:50 +0300 |
commit | be60f0a53c6da7121d99a5a2bfaa58519ebf4c8d (patch) | |
tree | a2fddb8247822c1def023b5b73661b1a9903363e /src/slic3r/GUI/GUI_ObjectSettings.cpp | |
parent | b856645f3ed43cce08baa0ce735d97b7a64eae05 (diff) | |
parent | aa147482b7adac21ea4a979cdf06ec545877f7c5 (diff) |
Merge remote-tracking branch 'origin/ys_msw_dpi'
Diffstat (limited to 'src/slic3r/GUI/GUI_ObjectSettings.cpp')
-rw-r--r-- | src/slic3r/GUI/GUI_ObjectSettings.cpp | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/slic3r/GUI/GUI_ObjectSettings.cpp b/src/slic3r/GUI/GUI_ObjectSettings.cpp index 1c5ca5a32..b8c0c41ae 100644 --- a/src/slic3r/GUI/GUI_ObjectSettings.cpp +++ b/src/slic3r/GUI/GUI_ObjectSettings.cpp @@ -59,6 +59,8 @@ ObjectSettings::ObjectSettings(wxWindow* parent) : m_settings_list_sizer = new wxBoxSizer(wxVERTICAL); m_og->sizer->Add(m_settings_list_sizer, 1, wxEXPAND | wxLEFT, 5); + + m_bmp_delete = PrusaBitmap(parent, "cross"); } void ObjectSettings::update_settings_list() @@ -77,11 +79,12 @@ void ObjectSettings::update_settings_list() { auto opt_key = (line.get_options())[0].opt_id; //we assume that we have one option per line - auto btn = new wxBitmapButton(parent, wxID_ANY, create_scaled_bitmap(m_parent, "cross"/*"colorchange_delete_on.png"*/), - wxDefaultPosition, wxDefaultSize, wxBORDER_NONE); -#ifdef __WXMSW__ - btn->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); -#endif // __WXMSW__ +// auto btn = new wxBitmapButton(parent, wxID_ANY, create_scaled_bitmap(m_parent, "cross"/*"colorchange_delete_on.png"*/), +// wxDefaultPosition, wxDefaultSize, wxBORDER_NONE); + auto btn = new PrusaButton(parent, wxID_ANY, m_bmp_delete); +//#ifdef __WXMSW__ +// btn->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); +//#endif // __WXMSW__ btn->Bind(wxEVT_BUTTON, [opt_key, config, this](wxEvent &event) { config->erase(opt_key); wxGetApp().obj_list()->changed_object(); @@ -123,8 +126,8 @@ void ObjectSettings::update_settings_list() continue; auto optgroup = std::make_shared<ConfigOptionsGroup>(m_og->ctrl_parent(), cat.first, config, false, extra_column); - optgroup->label_width = 15 * wxGetApp().em_unit(); - optgroup->sidetext_width = 5.5 * wxGetApp().em_unit(); + optgroup->label_width = 15; + optgroup->sidetext_width = 5.5; optgroup->m_on_change = [](const t_config_option_key& opt_id, const boost::any& value) { wxGetApp().obj_list()->changed_object(); }; @@ -134,11 +137,20 @@ void ObjectSettings::update_settings_list() if (opt == "extruder") continue; Option option = optgroup->get_option(opt); - option.opt.width = 12 * wxGetApp().em_unit(); + option.opt.width = 12; optgroup->append_single_option_line(option); } optgroup->reload_config(); m_settings_list_sizer->Add(optgroup->sizer, 0, wxEXPAND | wxALL, 0); + + // call back for rescaling of the extracolumn control + optgroup->rescale_extra_column_item = [this](wxWindow* win) { + auto *ctrl = dynamic_cast<PrusaButton*>(win); + if (ctrl == nullptr) + return; + ctrl->SetBitmap_(m_bmp_delete); + }; + m_og_settings.push_back(optgroup); categories.push_back(cat.first); @@ -163,5 +175,13 @@ void ObjectSettings::UpdateAndShow(const bool show) OG_Settings::UpdateAndShow(show); } +void ObjectSettings::rescale() +{ + m_bmp_delete.rescale(); + + for (auto group : m_og_settings) + group->rescale(); +} + } //namespace GUI } //namespace Slic3r
\ No newline at end of file |