Skip to content

Commit

Permalink
Fixed #6182 - First line custom gcode not aligned left in the tool tip
Browse files Browse the repository at this point in the history
  • Loading branch information
YuSanka committed Mar 8, 2021
1 parent 8adb495 commit 7cb3e72
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/slic3r/GUI/DoubleSlider.cpp
Expand Up @@ -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 ?
Expand All @@ -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
Expand Down

0 comments on commit 7cb3e72

Please sign in to comment.