Removed "Support materials" item from "Add Settings" context menu for the Layer ranges
Related to #3060 and #4100
This commit is contained in:
parent
40e4be6ede
commit
9bc96bf28e
1 changed files with 9 additions and 5 deletions
|
@ -1209,6 +1209,13 @@ static bool improper_category(const std::string& category, const int extruders_c
|
||||||
(!is_object_settings && category == "Support material");
|
(!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)
|
void ObjectList::get_options_menu(settings_menu_hierarchy& settings_menu, const bool is_part)
|
||||||
{
|
{
|
||||||
auto options = get_options(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());
|
const ItemType item_type = m_objects_model->GetItemType(GetSelection());
|
||||||
if (item_type == itUndef && !selection.is_single_full_object())
|
if (item_type == itUndef && !selection.is_single_full_object())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
const bool is_object_settings = item_type & itObject || item_type & itInstance ||
|
const bool is_object_settings = is_object_item(item_type);
|
||||||
// multi-selection in ObjectList, but full_object in Selection
|
|
||||||
(item_type == itUndef && selection.is_single_full_object());
|
|
||||||
create_freq_settings_popupmenu(menu, is_object_settings);
|
create_freq_settings_popupmenu(menu, is_object_settings);
|
||||||
|
|
||||||
if (mode == comAdvanced)
|
if (mode == comAdvanced)
|
||||||
|
@ -1821,8 +1826,7 @@ wxMenu* ObjectList::create_settings_popupmenu(wxMenu *parent_menu)
|
||||||
const wxDataViewItem selected_item = GetSelection();
|
const wxDataViewItem selected_item = GetSelection();
|
||||||
wxDataViewItem item = m_objects_model->GetItemType(selected_item) & itSettings ? m_objects_model->GetParent(selected_item) : selected_item;
|
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_object_item(m_objects_model->GetItemType(item)));
|
||||||
get_options_menu(settings_menu, is_part);
|
|
||||||
|
|
||||||
for (auto cat : settings_menu) {
|
for (auto cat : settings_menu) {
|
||||||
append_menu_item(menu, wxID_ANY, _(cat.first), "",
|
append_menu_item(menu, wxID_ANY, _(cat.first), "",
|
||||||
|
|
Loading…
Reference in a new issue