Skip to content

Commit 1346bd6

Browse files
committed
Fix \n not displayed
1 parent 99fe186 commit 1346bd6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/slic3r/GUI/Field.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,13 @@ void TextCtrl::BUILD() {
735735
const ConfigOptionStrings *vec = m_opt.get_default_value<ConfigOptionStrings>();
736736
if (vec == nullptr || vec->empty()) break; //for the case of empty default value
737737
text_value = vec->get_at(m_opt_idx);
738+
// For multiline fields, unescape newlines and other escape sequences
739+
if (m_opt.multiline) {
740+
std::string unescaped_value;
741+
if (unescape_string_cstyle(text_value.ToStdString(), unescaped_value)) {
742+
text_value = wxString::FromUTF8(unescaped_value);
743+
}
744+
}
738745
break;
739746
}
740747
case coPoint:
@@ -756,7 +763,7 @@ void TextCtrl::BUILD() {
756763
: builder2.build(m_parent, "", "", "", wxDefaultPosition, size, wxTE_PROCESS_ENTER);
757764
temp->SetLabel(_L(m_opt.sidetext));
758765
auto text_ctrl = m_opt.multiline ? (wxTextCtrl *)temp : ((TextInput *) temp)->GetTextCtrl();
759-
text_ctrl->SetLabel(text_value);
766+
text_ctrl->SetValue(text_value);
760767
temp->SetSize(size);
761768
m_combine_side_text = !m_opt.multiline;
762769
if (parent_is_custom_ctrl && m_opt.height < 0)

0 commit comments

Comments
 (0)