mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
FIX: empty param page remain in part tab
Change-Id: I41e90b53b0671df926ede7615e84b586e337b37a Jira: STUDIO-9072 (cherry picked from commit 0948b983d748f5823271b063417e1f514adbc807)
This commit is contained in:
@@ -155,6 +155,21 @@ void OptionsGroup::set_max_win_width(int max_win_width)
|
||||
custom_ctrl->set_max_win_width(max_win_width);
|
||||
}
|
||||
|
||||
void OptionsGroup::remove_option_if(std::function<bool(std::string const &)> const &comp)
|
||||
{
|
||||
for (auto &l : m_lines) {
|
||||
auto &opts = const_cast<std::vector<Option> &>(l.get_options());
|
||||
opts.erase(std::remove_if(opts.begin(), opts.end(), [&comp](Option &o) { return comp(o.opt.opt_key); }), opts.end());
|
||||
l.undo_to_sys = true;
|
||||
}
|
||||
for (int i = m_lines.size() - 1; i >= 0; --i) {
|
||||
if (m_lines[i].get_options().empty())
|
||||
m_options_mode.erase(m_options_mode.begin() + i);
|
||||
}
|
||||
m_lines.erase(std::remove_if(m_lines.begin(), m_lines.end(), [](auto &l) { return l.get_options().empty(); }), m_lines.end());
|
||||
// TODO: remove items from g->m_options;
|
||||
}
|
||||
|
||||
void OptionsGroup::show_field(const t_config_option_key& opt_key, bool show/* = true*/)
|
||||
{
|
||||
Field* field = get_field(opt_key);
|
||||
|
||||
Reference in New Issue
Block a user