Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2020-04-21 13:42:52 +0300
committerYuSanka <yusanka@gmail.com>2020-04-21 13:42:52 +0300
commit9bc96bf28e42ba6959283fbb731e23bb878cf579 (patch)
treefe9122dd24e6a102021ed3f913d4b1b5ebcb5aa7 /src/slic3r/GUI/GUI_ObjectList.cpp
parent40e4be6ede7a2140cf114eab5e8fd1dd9098effe (diff)
Removed "Support materials" item from "Add Settings" context menu for the Layer ranges
Related to #3060 and #4100
Diffstat (limited to 'src/slic3r/GUI/GUI_ObjectList.cpp')
-rw-r--r--src/slic3r/GUI/GUI_ObjectList.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp
index 5d06edad9..6297cace3 100644
--- a/src/slic3r/GUI/GUI_ObjectList.cpp
+++ b/src/slic3r/GUI/GUI_ObjectList.cpp
@@ -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), "",