ENH: filament preset edit menu should not change to self
jira: new Change-Id: Ia8eb3db05f83932d2eb0b8ef2ba8014e99c8e057
This commit is contained in:
parent
9097efd869
commit
12932832ae
|
@ -1361,7 +1361,7 @@ void MenuFactory::create_cut_cutter_menu()
|
|||
append_menu_item_change_type(menu);
|
||||
}
|
||||
|
||||
void MenuFactory::create_filament_action_menu(bool init)
|
||||
void MenuFactory::create_filament_action_menu(bool init, int active_filament_menu_id)
|
||||
{
|
||||
wxMenu *menu = &m_filament_action_menu;
|
||||
|
||||
|
@ -1380,6 +1380,9 @@ void MenuFactory::create_filament_action_menu(bool init)
|
|||
std::vector<wxBitmap*> icons = get_extruder_color_icons(true);
|
||||
int filaments_cnt = icons.size();
|
||||
for (int i = 0; i < filaments_cnt; i++) {
|
||||
if (i == active_filament_menu_id)
|
||||
continue;
|
||||
|
||||
auto preset = wxGetApp().preset_bundle->filaments.find_preset(wxGetApp().preset_bundle->filament_presets[i]);
|
||||
wxString item_name = preset ? from_u8(preset->label(false)) : wxString::Format(_L("Filament %d"), i + 1);
|
||||
|
||||
|
@ -1501,7 +1504,7 @@ void MenuFactory::init(wxWindow* parent)
|
|||
//BBS: add part plate related logic
|
||||
create_plate_menu();
|
||||
|
||||
create_filament_action_menu(true);
|
||||
create_filament_action_menu(true, -1);
|
||||
|
||||
// create "Instance to Object" menu item
|
||||
append_menu_item_instance_to_object(&m_instance_menu);
|
||||
|
@ -1680,8 +1683,8 @@ wxMenu* MenuFactory::assemble_multi_selection_menu()
|
|||
return menu;
|
||||
}
|
||||
|
||||
wxMenu *MenuFactory::filament_action_menu() {
|
||||
create_filament_action_menu(false);
|
||||
wxMenu *MenuFactory::filament_action_menu(int active_filament_menu_id) {
|
||||
create_filament_action_menu(false, active_filament_menu_id);
|
||||
return &m_filament_action_menu;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
wxMenu* assemble_part_menu();
|
||||
wxMenu* assemble_multi_selection_menu();
|
||||
|
||||
wxMenu *filament_action_menu();
|
||||
wxMenu *filament_action_menu(int active_filament_menu_id);
|
||||
|
||||
private:
|
||||
enum MenuType {
|
||||
|
@ -134,7 +134,7 @@ private:
|
|||
void create_bbl_assemble_part_menu();
|
||||
void create_cut_cutter_menu();
|
||||
|
||||
void create_filament_action_menu(bool init);
|
||||
void create_filament_action_menu(bool init, int active_filament_menu_id);
|
||||
|
||||
wxMenu* append_submenu_add_generic(wxMenu* menu, ModelVolumeType type);
|
||||
void append_menu_item_add_svg(wxMenu *menu, ModelVolumeType type, bool is_submenu_item = true);
|
||||
|
|
|
@ -1337,7 +1337,7 @@ void Sidebar::init_filament_combo(PlaterPresetComboBox **combo, const int filame
|
|||
|
||||
PlaterPresetComboBox* combobox = (*combo);
|
||||
edit_btn->Bind(wxEVT_BUTTON, [this, edit_btn, filament_idx](wxCommandEvent) {
|
||||
auto menu = p->plater->filament_action_menu();
|
||||
auto menu = p->plater->filament_action_menu(filament_idx);
|
||||
wxPoint pt { 0, edit_btn->GetSize().GetHeight() + 10 };
|
||||
pt = edit_btn->ClientToScreen(pt);
|
||||
pt = wxGetApp().mainframe->ScreenToClient(pt);
|
||||
|
@ -15223,7 +15223,7 @@ wxMenu* Plater::instance_menu() { return p->menus.instance_menu();
|
|||
wxMenu* Plater::layer_menu() { return p->menus.layer_menu(); }
|
||||
wxMenu* Plater::multi_selection_menu() { return p->menus.multi_selection_menu(); }
|
||||
wxMenu *Plater::assemble_multi_selection_menu() { return p->menus.assemble_multi_selection_menu(); }
|
||||
wxMenu *Plater::filament_action_menu() { return p->menus.filament_action_menu(); }
|
||||
wxMenu *Plater::filament_action_menu(int active_filament_menu_id) { return p->menus.filament_action_menu(active_filament_menu_id); }
|
||||
int Plater::GetPlateIndexByRightMenuInLeftUI() { return p->m_is_RightClickInLeftUI; }
|
||||
void Plater::SetPlateIndexByRightMenuInLeftUI(int index) { p->m_is_RightClickInLeftUI = index; }
|
||||
SuppressBackgroundProcessingUpdate::SuppressBackgroundProcessingUpdate() :
|
||||
|
|
|
@ -745,7 +745,7 @@ public:
|
|||
wxMenu* layer_menu();
|
||||
wxMenu* multi_selection_menu();
|
||||
wxMenu* assemble_multi_selection_menu();
|
||||
wxMenu* filament_action_menu();
|
||||
wxMenu* filament_action_menu(int active_filament_menu_id);
|
||||
int GetPlateIndexByRightMenuInLeftUI();
|
||||
void SetPlateIndexByRightMenuInLeftUI(int);
|
||||
static bool has_illegal_filename_characters(const wxString& name);
|
||||
|
|
Loading…
Reference in New Issue