rebuild menus from scratch to remove duplicate item check and match "delete" item order

This commit is contained in:
yw4z
2026-08-24 22:02:47 +03:00
parent ce75a66e7c
commit a3231aa723
2 changed files with 16 additions and 18 deletions
+8 -5
View File
@@ -4308,11 +4308,6 @@ void Sidebar::update_mixed_filament_list()
edit_mixed_filament(panel_idx);
}, edit_item->GetId());
auto* del_item = menu.Append(wxID_ANY, _L("Delete"));
menu.Bind(wxEVT_MENU, [this, panel_idx](wxCommandEvent&) {
delete_mixed_filament_at(panel_idx);
}, del_item->GetId());
wxMenu* sub_menu = new wxMenu();
std::vector<wxBitmap*> icons = get_extruder_color_icons(true);
int filaments_cnt = icons.size();
@@ -4345,6 +4340,14 @@ void Sidebar::update_mixed_filament_list()
else
delete sub_menu;
menu.AppendSeparator(); // ORCA use seperator for reducing accidental clicks to delete
// ORCA use delete item on end of menu to prevent accidental clicks. clicking to submenus(merge) already not allowed by OS
auto* del_item = menu.Append(wxID_ANY, _L("Delete"));
menu.Bind(wxEVT_MENU, [this, panel_idx](wxCommandEvent&) {
delete_mixed_filament_at(panel_idx);
}, del_item->GetId());
PopupMenu(&menu);
});
combo_and_btn_sizer->Add(menu_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(4));