mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-11 17:49:00 +08:00
FIX:got the wrong name of the selected filament
jira: none Change-Id: I476bd1dfb995a0868161184c0c5782e1cae4dde3
This commit is contained in:
parent
7b507d4a6a
commit
31a7f19b98
@ -231,8 +231,10 @@ int PresetComboBox::update_ams_color()
|
|||||||
int idx = selected_ams_filament();
|
int idx = selected_ams_filament();
|
||||||
std::string color;
|
std::string color;
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
auto *preset = m_collection->find_preset(Preset::remove_suffix_modified(GetLabel().ToUTF8().data()));
|
auto name = Preset::remove_suffix_modified(GetValue().ToUTF8().data());
|
||||||
if (preset) color = preset->config.opt_string("default_filament_colour", 0u);
|
auto *preset = m_collection->find_preset(name);
|
||||||
|
if (preset)
|
||||||
|
color = preset->config.opt_string("default_filament_colour", 0u);
|
||||||
if (color.empty()) return -1;
|
if (color.empty()) return -1;
|
||||||
} else {
|
} else {
|
||||||
auto &ams_list = wxGetApp().preset_bundle->filament_ams_list;
|
auto &ams_list = wxGetApp().preset_bundle->filament_ams_list;
|
||||||
@ -917,7 +919,7 @@ void PlaterPresetComboBox::OnSelect(wxCommandEvent &evt)
|
|||||||
wxTheApp->CallAfter([sp]() { run_wizard(sp); });
|
wxTheApp->CallAfter([sp]() { run_wizard(sp); });
|
||||||
//}
|
//}
|
||||||
return;
|
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;
|
m_last_selected = selected_item;
|
||||||
if (m_type == Preset::TYPE_FILAMENT)
|
if (m_type == Preset::TYPE_FILAMENT)
|
||||||
update_ams_color();
|
update_ams_color();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user