Fixed #6182 - First line custom gcode not aligned left in the tool tip

This commit is contained in:
YuSanka 2021-03-08 14:19:58 +01:00
parent 8adb495e7d
commit 7cb3e729ee

View file

@ -1317,7 +1317,12 @@ wxString Control::get_tooltip(int tick/*=-1*/)
"This code won't be processed during G-code generation.");
// Show custom Gcode as a first string of tooltop
tooltip = " ";
std::string space = " ";
tooltip = space;
auto format_gcode = [space](std::string gcode) {
boost::replace_all(gcode, "\n", "\n" + space);
return gcode;
};
tooltip +=
tick_code_it->type == ColorChange ?
(m_mode == SingleExtruder ?
@ -1329,7 +1334,7 @@ wxString Control::get_tooltip(int tick/*=-1*/)
format_wxstr(_L("Custom template (\"%1%\")"), gcode(Template)) :
tick_code_it->type == ToolChange ?
format_wxstr(_L("Extruder (tool) is changed to Extruder \"%1%\""), tick_code_it->extruder) :
from_u8(tick_code_it->extra);// tick_code_it->type == Custom
from_u8(format_gcode(tick_code_it->extra));// tick_code_it->type == Custom
// If tick is marked as a conflict (exclamation icon),
// we should to explain why