diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index 41846500de..9f3f34f844 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -218,47 +218,12 @@ InfoDialog::InfoDialog(wxWindow* parent, const wxString &title, const wxString& : MsgDialog(parent, wxString::Format(_L("%s information"), SLIC3R_APP_NAME), title) , msg(msg) { - this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - - // Text shown as HTML, so that mouse selection and Ctrl-V to copy will work. - wxHtmlWindow* html = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO); - { - wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); - wxFont monospace = wxGetApp().code_font(); - wxColour text_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); - wxColour bgr_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); - auto text_clr_str = wxString::Format(wxT("#%02X%02X%02X"), text_clr.Red(), text_clr.Green(), text_clr.Blue()); - auto bgr_clr_str = wxString::Format(wxT("#%02X%02X%02X"), bgr_clr.Red(), bgr_clr.Green(), bgr_clr.Blue()); - const int font_size = font.GetPointSize() - 1; - int size[] = { font_size, font_size, font_size, font_size, font_size, font_size, font_size }; - html->SetFonts(font.GetFaceName(), monospace.GetFaceName(), size); - html->SetBorders(2); - - // calculate html page size from text - int lines = msg.Freq('\n'); - - if (msg.Contains("")) { - int pos = 0; - while (pos < (int)msg.Len() && pos != wxNOT_FOUND) { - pos = msg.find("", pos + 1); - lines+=2; - } - } - int page_height = std::min((font.GetPixelSize().y + 1) * lines, 68 * wxGetApp().em_unit()); - wxSize page_size(68 * wxGetApp().em_unit(), page_height); - - html->SetMinSize(page_size); - - std::string msg_escaped = xml_escape(msg.ToUTF8().data(), true); - boost::replace_all(msg_escaped, "\r\n", "
"); - boost::replace_all(msg_escaped, "\n", "
"); - html->SetPage("" + wxString::FromUTF8(msg_escaped.data()) + ""); - content_sizer->Add(html, 1, wxEXPAND); - } - + add_msg_content(this, content_sizer, msg); // Set info bitmap logo->SetBitmap(create_scaled_bitmap("info", this, 84)); + wxGetApp().UpdateDlgDarkUI(this); + Fit(); }