ENH:flush_option display only when multi-color

Change-Id: I510444818eda820f4f54ecbb0063142467cbf334
This commit is contained in:
liz.li 2022-11-14 11:08:59 +08:00 committed by Lane.Wei
parent 49b00bfcd2
commit 82f1bad002

View file

@ -732,10 +732,22 @@ void MenuFactory::append_menu_items_flush_options(wxMenu* menu)
if (item_id != wxNOT_FOUND)
menu->Destroy(item_id);
bool show_flush_option_menu = false;
ObjectList* object_list = obj_list();
const Selection& selection = get_selection();
if (wxGetApp().plater()->get_partplate_list().get_curr_plate()->contains(selection.get_bounding_box())) {
auto plate_extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_extruders();
for (auto extruder : plate_extruders) {
if (extruder != plate_extruders[0])
show_flush_option_menu = true;
}
}
if (!show_flush_option_menu)
return;
DynamicPrintConfig& global_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
ModelConfig& select_object_config = object_list->object(selection.get_object_idx())->config;
auto keys = select_object_config.keys();
DynamicPrintConfig& global_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;