diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 9280865b0..de61488ef 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -1200,7 +1200,7 @@ void Choice::set_value(const boost::any& value, bool change_event) } case coEnum: { int val = boost::any_cast(value); - if (m_opt_id == "top_fill_pattern" || m_opt_id == "bottom_fill_pattern" || m_opt_id == "fill_pattern" || m_opt_id == "support_material_style") + if (m_opt_id == "top_fill_pattern" || m_opt_id == "bottom_fill_pattern" || m_opt_id == "fill_pattern") { std::string key; const t_config_enum_values& map_names = ConfigOptionEnum::get_enum_values(); @@ -1214,6 +1214,20 @@ void Choice::set_value(const boost::any& value, bool change_event) auto it = std::find(values.begin(), values.end(), key); val = it == values.end() ? 0 : it - values.begin(); } + else if (m_opt_id == "support_material_style") + { + std::string key; + const t_config_enum_values& map_names = ConfigOptionEnum::get_enum_values(); + for (auto it : map_names) + if (val == it.second) { + key = it.first; + break; + } + + const std::vector& values = m_opt.enum_values; + auto it = std::find(values.begin(), values.end(), key); + val = it == values.end() ? 0 : it - values.begin(); + } field->SetSelection(val); break; }