mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
WIP: Pad quick-menu
This commit is contained in:
parent
92e1649606
commit
b8bfe001c0
1 changed files with 360 additions and 344 deletions
|
@ -556,14 +556,21 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent) :
|
|||
Tab* tab = wxGetApp().get_tab(Preset::TYPE_SLA_PRINT);
|
||||
if (!tab) return;
|
||||
|
||||
if (opt_key == "pad_enable") {
|
||||
tab->set_value(opt_key, value);
|
||||
tab->update();
|
||||
DynamicPrintConfig new_conf = *config_sla;
|
||||
if (opt_key == "pad") {
|
||||
const wxString& selection = boost::any_cast<wxString>(value);
|
||||
|
||||
const bool pad_enable = selection == _("None") ? false : true;
|
||||
new_conf.set_key_value("pad_enable", new ConfigOptionBool(pad_enable));
|
||||
|
||||
if (selection == _("Below object"))
|
||||
new_conf.set_key_value("pad_zero_elevation", new ConfigOptionBool(false));
|
||||
else if (selection == _("Around object"))
|
||||
new_conf.set_key_value("pad_zero_elevation", new ConfigOptionBool(true));
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(opt_key == "support");
|
||||
DynamicPrintConfig new_conf = *config_sla;
|
||||
const wxString& selection = boost::any_cast<wxString>(value);
|
||||
|
||||
const bool supports_enable = selection == _("None") ? false : true;
|
||||
|
@ -573,10 +580,9 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent) :
|
|||
new_conf.set_key_value("support_buildplate_only", new ConfigOptionBool(false));
|
||||
else if (selection == _("Support on build plate only"))
|
||||
new_conf.set_key_value("support_buildplate_only", new ConfigOptionBool(true));
|
||||
|
||||
tab->load_config(new_conf);
|
||||
}
|
||||
|
||||
tab->load_config(new_conf);
|
||||
tab->update_dirty();
|
||||
};
|
||||
|
||||
|
@ -594,9 +600,19 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent) :
|
|||
|
||||
line = Line{ "", "" };
|
||||
|
||||
option = m_og_sla->get_option("pad_enable");
|
||||
option.opt.sidetext = " ";
|
||||
ConfigOptionDef pad_def;
|
||||
pad_def.label = L("Pad");
|
||||
pad_def.type = coStrings;
|
||||
pad_def.gui_type = "select_open";
|
||||
pad_def.tooltip = L("Select what kind of pad do you need");
|
||||
pad_def.enum_labels.push_back(L("None"));
|
||||
pad_def.enum_labels.push_back(L("Below object"));
|
||||
pad_def.enum_labels.push_back(L("Around object"));
|
||||
pad_def.set_default_value(new ConfigOptionStrings{ "Below object" });
|
||||
option = Option(pad_def, "pad");
|
||||
option.opt.full_width = true;
|
||||
line.append_option(option);
|
||||
line.append_widget(empty_widget);
|
||||
|
||||
m_og_sla->append_line(line);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue