Add pattern in infill checkbox

This commit is contained in:
QIDI TECH
2023-08-19 13:55:15 +08:00
parent 42a146b5af
commit b33907514e
2 changed files with 34 additions and 19 deletions

View File

@@ -1948,7 +1948,7 @@ void PrintConfigDef::init_fff_params()
//B25 //B25
def = this->add("enable_volume_fan", coInts); def = this->add("enable_volume_fan", coInts);
def->label = L("Volume Fan Speed"); def->label = L("Chamber Fan Speed");
def->tooltip = L("This setting represents the PWM your volume fan needs to work."); def->tooltip = L("This setting represents the PWM your volume fan needs to work.");
def->sidetext = L("%"); def->sidetext = L("%");
def->min = 0; def->min = 0;

View File

@@ -1018,7 +1018,7 @@ void Choice::BUILD() {
// recast as a wxWindow to fit the calling convention // recast as a wxWindow to fit the calling convention
window = dynamic_cast<wxWindow*>(temp); window = dynamic_cast<wxWindow*>(temp);
//Y10
/*if (m_opt.enum_def) { /*if (m_opt.enum_def) {
if (auto& labels = m_opt.enum_def->labels(); !labels.empty()) { if (auto& labels = m_opt.enum_def->labels(); !labels.empty()) {
bool localized = m_opt.enum_def->has_labels(); bool localized = m_opt.enum_def->has_labels();
@@ -1028,22 +1028,37 @@ void Choice::BUILD() {
} }
}*/ }*/
if (m_opt.enum_def) { if (m_opt.enum_def) {
// Append localized enum_labels if (auto& labels = m_opt.enum_def->labels(); !labels.empty())
int i = 0; {
bool localized = m_opt.enum_def->has_labels();
boost::filesystem::path image_path(Slic3r::resources_dir()); boost::filesystem::path image_path(Slic3r::resources_dir());
image_path /= "icons"; image_path /= "icons";
for (auto el : m_opt.enum_def->labels()) { for (const std::string& el : labels)
auto icon_name = "param_" + m_opt.enum_def->labels()[i]; {
if (boost::filesystem::exists(image_path / (icon_name + ".svg"))) { std::vector <std::string> show_pattern_options{ "fill_pattern", "top_fill_pattern", "bottom_fill_pattern", "support_material_pattern","support_material_interface_pattern" };
ScalableBitmap bm(temp, icon_name, 24); bool show_pattern = false;
temp->Append(_(el), bm.bmp()); for (auto sp_option : show_pattern_options)
} else { if (m_opt.opt_key == sp_option)
temp->Append(_(el)); {
show_pattern = true;
break;
} }
++i; if (show_pattern)
{
auto icon_name = "param_" + el;
transform(icon_name.begin(), icon_name.end(), icon_name.begin(), ::tolower);
if (boost::filesystem::exists(image_path / (icon_name + ".svg")))
{
ScalableBitmap bm(temp, icon_name);
temp->Append(localized ? _(from_u8(el)) : from_u8(el), bm.bmp());
}
}
else
temp->Append(localized ? _(from_u8(el)) : from_u8(el));
} }
set_selection(); set_selection();
} }
}
temp->Bind(wxEVT_MOUSEWHEEL, [this](wxMouseEvent& e) { temp->Bind(wxEVT_MOUSEWHEEL, [this](wxMouseEvent& e) {
if (m_suppress_scroll && !m_is_dropped) if (m_suppress_scroll && !m_is_dropped)