From 8e7958da124d128e8d4b8ebdec3ec6bf2c00af47 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 7 Jan 2021 12:26:16 +0100 Subject: [PATCH] Fix of #5698 - When editing presets, list items are always green even if values have changed compared to preset or defaults --- src/slic3r/GUI/Tab.cpp | 8 ++++---- src/slic3r/GUI/Tab.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 0656c7e0d..a0d7d17f2 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -501,7 +501,7 @@ void Tab::update_labels_colour() if (opt.first == "bed_shape" || opt.first == "filament_ramming_parameters" || opt.first == "compatible_prints" || opt.first == "compatible_printers" ) { if (m_colored_Label_colors.find(opt.first) != m_colored_Label_colors.end()) - *m_colored_Label_colors.at(opt.first) = *color; + m_colored_Label_colors.at(opt.first) = *color; continue; } @@ -540,7 +540,7 @@ void Tab::decorate() if (opt.first == "bed_shape" || opt.first == "filament_ramming_parameters" || opt.first == "compatible_prints" || opt.first == "compatible_printers") - colored_label_clr = (m_colored_Label_colors.find(opt.first) == m_colored_Label_colors.end()) ? nullptr : m_colored_Label_colors.at(opt.first); + colored_label_clr = (m_colored_Label_colors.find(opt.first) == m_colored_Label_colors.end()) ? nullptr : &m_colored_Label_colors.at(opt.first); if (!colored_label_clr) { field = get_field(opt.first); @@ -3553,8 +3553,8 @@ void Tab::create_line_with_widget(ConfigOptionsGroup* optgroup, const std::strin line.widget = widget; line.label_path = path; - m_colored_Label_colors[opt_key] = &m_default_text_clr; - line.full_Label_color = m_colored_Label_colors[opt_key]; + m_colored_Label_colors[opt_key] = m_default_text_clr; + line.full_Label_color = &m_colored_Label_colors[opt_key]; optgroup->append_line(line); } diff --git a/src/slic3r/GUI/Tab.hpp b/src/slic3r/GUI/Tab.hpp index 04aa9a0ef..927787933 100644 --- a/src/slic3r/GUI/Tab.hpp +++ b/src/slic3r/GUI/Tab.hpp @@ -246,7 +246,7 @@ public: // map of option name -> wxColour (color of the colored label, associated with option) // Used for options which don't have corresponded field - std::map m_colored_Label_colors; + std::map m_colored_Label_colors; // Counter for the updating (because of an update() function can have a recursive behavior): // 1. increase value from the very beginning of an update() function