Removed "Support materials" item from "Add Settings" context menu for the Layer ranges

Related to #3060 and #4100
This commit is contained in:
YuSanka 2020-04-21 12:42:52 +02:00
parent 40e4be6ede
commit 9bc96bf28e

View file

@ -1209,6 +1209,13 @@ static bool improper_category(const std::string& category, const int extruders_c
(!is_object_settings && category == "Support material");
}
static bool is_object_item(ItemType item_type)
{
return item_type & itObject || item_type & itInstance ||
// multi-selection in ObjectList, but full_object in Selection
(item_type == itUndef && scene_selection().is_single_full_object());
}
void ObjectList::get_options_menu(settings_menu_hierarchy& settings_menu, const bool is_part)
{
auto options = get_options(is_part);
@ -1579,9 +1586,7 @@ wxMenuItem* ObjectList::append_menu_item_settings(wxMenu* menu_)
const ItemType item_type = m_objects_model->GetItemType(GetSelection());
if (item_type == itUndef && !selection.is_single_full_object())
return nullptr;
const bool is_object_settings = item_type & itObject || item_type & itInstance ||
// multi-selection in ObjectList, but full_object in Selection
(item_type == itUndef && selection.is_single_full_object());
const bool is_object_settings = is_object_item(item_type);
create_freq_settings_popupmenu(menu, is_object_settings);
if (mode == comAdvanced)
@ -1821,8 +1826,7 @@ wxMenu* ObjectList::create_settings_popupmenu(wxMenu *parent_menu)
const wxDataViewItem selected_item = GetSelection();
wxDataViewItem item = m_objects_model->GetItemType(selected_item) & itSettings ? m_objects_model->GetParent(selected_item) : selected_item;
const bool is_part = !(m_objects_model->GetItemType(item) == itObject || scene_selection().is_single_full_object());
get_options_menu(settings_menu, is_part);
get_options_menu(settings_menu, !is_object_item(m_objects_model->GetItemType(item)));
for (auto cat : settings_menu) {
append_menu_item(menu, wxID_ANY, _(cat.first), "",