mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 09:02:06 +00:00
Fix: Dirty-state marker ("*") not shown for edited system printer presets (#11900)
Fix missing dirty marker for edited system printer presets System printer presets did not display the modified (“*”) marker in the sidebar when edited. Unlike other preset types, printer presets use `printer_model` as their display label, bypassing the normal dirty-state formatting. This patch prepends the modified suffix to the displayed name when the selected system printer preset is dirty, restoring consistent UI behavior across all preset types.
This commit is contained in:
@@ -1210,14 +1210,24 @@ void PlaterPresetComboBox::update()
|
||||
//BBS: move system to the end
|
||||
if (m_type == Preset::TYPE_PRINTER) {
|
||||
auto printer_model = preset.config.opt_string("printer_model");
|
||||
name = from_u8(printer_model);
|
||||
|
||||
// ORCA: Make system printer presets display the dirty "*" prefix when edited.
|
||||
name = from_u8(is_selected && preset.is_dirty ? Preset::suffix_modified() + printer_model : printer_model);
|
||||
|
||||
if (system_printer_models.count(printer_model) == 0) {
|
||||
system_presets.emplace(name, bmp);
|
||||
system_printer_models.insert(printer_model);
|
||||
}
|
||||
else if (is_selected) {
|
||||
const wxString alternate_name = from_u8(preset.is_dirty ? printer_model : Preset::suffix_modified() + printer_model);
|
||||
// Remove the old preset name if exists, and add the new one with the same name but with modified suffix if needed.
|
||||
if (system_presets.erase(alternate_name))
|
||||
system_presets.emplace(name, bmp);
|
||||
}
|
||||
} else {
|
||||
system_presets.emplace(name, bmp);
|
||||
}
|
||||
|
||||
if (is_selected) {
|
||||
tooltip = get_tooltip(preset);
|
||||
selected_system_preset = name;
|
||||
|
||||
Reference in New Issue
Block a user