From 4dbcb8152c963e87c43deaf842f82f52781257d7 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Fri, 18 Apr 2025 16:29:24 +0800 Subject: [PATCH] FIX:got the wrong name of the selected filament jira: none Change-Id: I476bd1dfb995a0868161184c0c5782e1cae4dde3 (cherry picked from commit 31a7f19b983374ccf6e1b57de8fb635ef7e24184) --- src/slic3r/GUI/PresetComboBoxes.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index 40114c6035..d51ea18b68 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -230,8 +230,10 @@ int PresetComboBox::update_ams_color() int idx = selected_ams_filament(); std::string color; if (idx < 0) { - auto *preset = m_collection->find_preset(Preset::remove_suffix_modified(GetLabel().ToUTF8().data())); - if (preset) color = preset->config.opt_string("default_filament_colour", 0u); + auto name = Preset::remove_suffix_modified(GetValue().ToUTF8().data()); + auto *preset = m_collection->find_preset(name); + if (preset) + color = preset->config.opt_string("default_filament_colour", 0u); if (color.empty()) return -1; } else { auto &ams_list = wxGetApp().preset_bundle->filament_ams_list; @@ -911,7 +913,7 @@ void PlaterPresetComboBox::OnSelect(wxCommandEvent &evt) wxTheApp->CallAfter([sp]() { run_wizard(sp); }); //} return; - } else if (marker == LABEL_ITEM_PHYSICAL_PRINTER || m_last_selected != selected_item || m_collection->current_is_dirty()) { + } else if (marker == LABEL_ITEM_PHYSICAL_PRINTER || selected_item >= 0 || m_collection->current_is_dirty()) { m_last_selected = selected_item; if (m_type == Preset::TYPE_FILAMENT) update_ams_color();