Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_splitted_vbuffer

This commit is contained in:
enricoturri1966 2021-01-26 10:10:23 +01:00
commit 9ede830f66
25 changed files with 481 additions and 29 deletions

View file

@ -160,6 +160,26 @@ void Control::msw_rescale()
GetParent()->Layout();
}
void Control::sys_color_changed()
{
m_bmp_add_tick_on .msw_rescale();
m_bmp_add_tick_off.msw_rescale();
m_bmp_del_tick_on .msw_rescale();
m_bmp_del_tick_off.msw_rescale();
m_tick_icon_dim = m_bmp_add_tick_on.GetBmpWidth();
m_bmp_one_layer_lock_on .msw_rescale();
m_bmp_one_layer_lock_off .msw_rescale();
m_bmp_one_layer_unlock_on .msw_rescale();
m_bmp_one_layer_unlock_off.msw_rescale();
m_lock_icon_dim = m_bmp_one_layer_lock_on.GetBmpWidth();
m_bmp_revert.msw_rescale();
m_revert_icon_dim = m_bmp_revert.GetBmpWidth();
m_bmp_cog.msw_rescale();
m_cog_icon_dim = m_bmp_cog.GetBmpWidth();
}
int Control::GetActiveValue() const
{
return m_selection == ssLower ?

View file

@ -192,6 +192,7 @@ public:
~Control() {}
void msw_rescale();
void sys_color_changed();
int GetMinValue() const { return m_min_value; }
int GetMaxValue() const { return m_max_value; }

View file

@ -1200,6 +1200,10 @@ boost::any& Choice::get_value()
}
else if (m_opt_id.compare("ironing_type") == 0)
m_value = static_cast<IroningType>(ret_enum);
else if (m_opt_id.compare("fuzzy_skin_perimeter_mode") == 0)
m_value = static_cast<FuzzySkinPerimeterMode>(ret_enum);
else if (m_opt_id.compare("fuzzy_skin_shape") == 0)
m_value = static_cast<FuzzySkinShape>(ret_enum);
else if (m_opt_id.compare("gcode_flavor") == 0)
m_value = static_cast<GCodeFlavor>(ret_enum);
else if (m_opt_id.compare("machine_limits_usage") == 0)

View file

@ -182,6 +182,10 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
config.set_key_value(opt_key, new ConfigOptionEnum<InfillPattern>(boost::any_cast<InfillPattern>(value)));
else if (opt_key.compare("ironing_type") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<IroningType>(boost::any_cast<IroningType>(value)));
else if (opt_key.compare("fuzzy_skin_perimeter_mode") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<FuzzySkinPerimeterMode>(boost::any_cast<FuzzySkinPerimeterMode>(value)));
else if (opt_key.compare("fuzzy_skin_shape") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<FuzzySkinShape>(boost::any_cast<FuzzySkinShape>(value)));
else if (opt_key.compare("gcode_flavor") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<GCodeFlavor>(boost::any_cast<GCodeFlavor>(value)));
else if (opt_key.compare("machine_limits_usage") == 0)

View file

@ -410,6 +410,12 @@ void Preview::msw_rescale()
refresh_print();
}
void Preview::sys_color_changed()
{
if (m_layers_slider != nullptr)
m_layers_slider->sys_color_changed();
}
void Preview::jump_layers_slider(wxKeyEvent& evt)
{
if (m_layers_slider) m_layers_slider->OnChar(evt);

View file

@ -150,6 +150,7 @@ public:
void refresh_print();
void msw_rescale();
void sys_color_changed();
void jump_layers_slider(wxKeyEvent& evt);
void move_layers_slider(wxKeyEvent& evt);
void edit_layers_slider(wxKeyEvent& evt);

View file

@ -108,6 +108,7 @@ public:
// recalc_font();
#ifndef __WXOSX__
#if wxVERSION_EQUAL_OR_GREATER_THAN(3,1,3)
this->Bind(wxEVT_DPI_CHANGED, [this](wxDPIChangedEvent& evt) {
m_scale_factor = (float)evt.GetNewDPI().x / (float)DPI_DEFAULT;
@ -128,6 +129,7 @@ public:
rescale(evt.rect);
});
#endif // wxVERSION_EQUAL_OR_GREATER_THAN
#endif // no __WXOSX__
this->Bind(wxEVT_MOVE_START, [this](wxMoveEvent& event)
{

View file

@ -360,6 +360,9 @@ void OG_CustomCtrl::correct_widgets_position(wxSizer* widget, const Line& line,
void OG_CustomCtrl::msw_rescale()
{
#ifdef __WXOSX__
return;
#endif
m_font = wxGetApp().normal_font();
m_em_unit = em_unit(m_parent);
m_v_gap = lround(1.0 * m_em_unit);
@ -381,7 +384,6 @@ void OG_CustomCtrl::msw_rescale()
void OG_CustomCtrl::sys_color_changed()
{
msw_rescale();
}
OG_CustomCtrl::CtrlLine::CtrlLine( wxCoord height,

View file

@ -870,6 +870,12 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
else if (opt_key == "ironing_type") {
ret = static_cast<int>(config.option<ConfigOptionEnum<IroningType>>(opt_key)->value);
}
else if (opt_key == "fuzzy_skin_perimeter_mode") {
ret = static_cast<int>(config.option<ConfigOptionEnum<FuzzySkinPerimeterMode>>(opt_key)->value);
}
else if (opt_key == "fuzzy_skin_shape") {
ret = static_cast<int>(config.option<ConfigOptionEnum<FuzzySkinShape>>(opt_key)->value);
}
else if (opt_key == "gcode_flavor") {
ret = static_cast<int>(config.option<ConfigOptionEnum<GCodeFlavor>>(opt_key)->value);
}

View file

@ -6209,6 +6209,7 @@ void Plater::msw_rescale()
void Plater::sys_color_changed()
{
p->preview->sys_color_changed();
p->sidebar->sys_color_changed();
// msw_rescale_menu updates just icons, so use it

View file

@ -1434,6 +1434,18 @@ void TabPrint::build()
optgroup->append_single_option_line("seam_position", category_path + "seam-position");
optgroup->append_single_option_line("external_perimeters_first", category_path + "external-perimeters-first");
optgroup = page->new_optgroup(L("Fuzzy skin (experimental)"));
Option option = optgroup->get_option("fuzzy_skin_perimeter_mode");
option.opt.width = 30;
optgroup->append_single_option_line(option);
#if 0
option = optgroup->get_option("fuzzy_skin_shape");
option.opt.width = 30;
optgroup->append_single_option_line(option);
#endif
optgroup->append_single_option_line(optgroup->get_option("fuzzy_skin_thickness"));
optgroup->append_single_option_line(optgroup->get_option("fuzzy_skin_point_dist"));
page = add_options_page(L("Infill"), "infill");
category_path = "infill_42#";
optgroup = page->new_optgroup(L("Infill"));
@ -1597,7 +1609,7 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Output file"));
optgroup->append_single_option_line("gcode_comments");
optgroup->append_single_option_line("gcode_label_objects");
Option option = optgroup->get_option("output_filename_format");
option = optgroup->get_option("output_filename_format");
option.opt.full_width = true;
optgroup->append_single_option_line(option);