From b8e1cfb2afea1a0d3706e6850fbbf816470382a4 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 9 Jun 2023 15:44:15 +0200 Subject: [PATCH] Show/Hide template filament profiles from "cog" context menu on sidebar. --- src/slic3r/GUI/PresetComboBoxes.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index 25beb87bc..ac189f826 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -644,13 +644,7 @@ PlaterPresetComboBox::PlaterPresetComboBox(wxWindow *parent, Preset::Type preset edit_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent) { - // In a case of a physical printer, for its editing open PhysicalPrinterDialog - if (m_type == Preset::TYPE_PRINTER -#ifdef __linux__ - // To edit extruder color from the sidebar - || m_type == Preset::TYPE_FILAMENT -#endif //__linux__ - ) + if (m_type == Preset::TYPE_PRINTER || m_type == Preset::TYPE_FILAMENT) show_edit_menu(); else switch_to_tab(); @@ -784,15 +778,18 @@ void PlaterPresetComboBox::show_edit_menu() append_menu_item(menu, wxID_ANY, _L("Edit preset"), "", [this](wxCommandEvent&) { this->switch_to_tab(); }, "cog", menu, []() { return true; }, wxGetApp().plater()); -#ifdef __linux__ - // To edit extruder color from the sidebar if (m_type == Preset::TYPE_FILAMENT) { +#ifdef __linux__ + // To edit extruder color from the sidebar append_menu_item(menu, wxID_ANY, _L("Change extruder color"), "", [this](wxCommandEvent&) { this->change_extruder_color(); }, "funnel", menu, []() { return true; }, wxGetApp().plater()); +#endif //__linux__ + append_menu_item(menu, wxID_ANY, _L("Show/Hide template presets"), "", + [this](wxCommandEvent&) { wxGetApp().open_preferences("no_templates", "General"); }, "spool", menu, []() { return true; }, wxGetApp().plater()); + wxGetApp().plater()->PopupMenu(menu); return; } -#endif //__linux__ if (this->is_selected_physical_printer()) { append_menu_item(menu, wxID_ANY, _L("Edit physical printer"), "",