From 7dddcf9d05a9a646ce12f2e4ad484ce6e54ee782 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Mon, 1 Aug 2022 14:58:00 +0800 Subject: [PATCH] FIX: show param tip for fields Change-Id: I4d2151c69f596a940c7be933bca9710838494c87 --- src/slic3r/GUI/Field.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 75720dda0..1cacb1788 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -195,22 +195,23 @@ void Field::toggle(bool en) { en && !m_opt.readonly ? enable() : disable(); } wxString Field::get_tooltip_text(const wxString &default_string) { wxString tooltip_text(""); - //wxString tooltip = _(m_opt.tooltip); - // edit_tooltip(tooltip); +#ifdef NDEBUG + wxString tooltip = _(m_opt.tooltip); + edit_tooltip(tooltip); - // std::string opt_id = m_opt_id; - // auto hash_pos = opt_id.find("#"); - // if (hash_pos != std::string::npos) { - // opt_id.replace(hash_pos, 1,"["); - // opt_id += "]"; - // } - - //if (tooltip.length() > 0) - // tooltip_text = tooltip + "\n" + _(L("default value")) + "\t: " + - // (boost::iends_with(opt_id, "_gcode") ? "\n" : "") + default_string + - // (boost::iends_with(opt_id, "_gcode") ? "" : "\n") + - // _(L("parameter name")) + "\t: " + opt_id; + std::string opt_id = m_opt_id; + auto hash_pos = opt_id.find("#"); + if (hash_pos != std::string::npos) { + opt_id.replace(hash_pos, 1,"["); + opt_id += "]"; + } + if (tooltip.length() > 0) + tooltip_text = tooltip + "\n" + _(L("default value")) + "\t: " + + (boost::iends_with(opt_id, "_gcode") ? "\n" : "") + default_string + + (boost::iends_with(opt_id, "_gcode") ? "" : "\n") + + _(L("parameter name")) + "\t: " + opt_id; + #endif return tooltip_text; }