From e34892328333fb8da548f73141b8da48793887d3 Mon Sep 17 00:00:00 2001 From: Jessy LANGE <89694096+jessy2027@users.noreply.github.com> Date: Fri, 4 Jul 2025 18:29:47 +0200 Subject: [PATCH] GUI: Add filament notes to material selector tooltip (#10051) * GUI: Add filament notes to material selector tooltip Enhances material selector tooltip to display filament notes from preset configuration. Adds automatic truncation for notes longer than 200 characters with ellipsis. Improves user experience by providing material context directly in tooltip. Fixes #10037 * GUI: Add filament notes to material selector tooltip Enhances material selector tooltip to display filament notes from preset configuration. Adds automatic truncation for notes longer than 200 characters with ellipsis. Improves user experience by providing material context directly in tooltip. Fixes #10037 * GUI: Fix tooltip display for unsaved profile notes --- src/slic3r/GUI/PresetComboBoxes.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index ae6a79f8b4..87b0287255 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -263,6 +263,28 @@ wxColor PresetComboBox::different_color(wxColor const &clr) wxString PresetComboBox::get_tooltip(const Preset &preset) { wxString tooltip = from_u8(preset.name); + + // Add filament notes if available for filament presets + if (m_type == Preset::TYPE_FILAMENT) { + const DynamicConfig* config = &preset.config; + Tab* tab = wxGetApp().get_tab(m_type); + if (tab && tab->current_preset_is_dirty() && tab->get_presets()->get_selected_preset().name == preset.name) { + config = tab->get_config(); + } + + if (config->has("filament_notes")) { + const ConfigOptionStrings* notes_opt = config->option("filament_notes"); + if (notes_opt && !notes_opt->values.empty() && !notes_opt->values[0].empty()) { + std::string notes = notes_opt->values[0]; + // Truncate if longer than 200 characters + if (notes.length() > 200) { + notes = notes.substr(0, 197) + "..."; + } + tooltip += "\n" + from_u8(notes); + } + } + } + // BBS: FIXME #if 0 if (m_type == Preset::TYPE_FILAMENT) {