#include "AboutDialog.hpp" #include "I18N.hpp" #include "libslic3r/Utils.hpp" #include "GUI_App.hpp" #include "wxExtensions.hpp" namespace Slic3r { namespace GUI { AboutDialogLogo::AboutDialogLogo(wxWindow* parent) : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize) { this->SetBackgroundColour(*wxWHITE); this->logo = wxBitmap(from_u8(Slic3r::var("Slic3r_192px.png")), wxBITMAP_TYPE_PNG); this->SetMinSize(this->logo.GetSize()); this->Bind(wxEVT_PAINT, &AboutDialogLogo::onRepaint, this); } void AboutDialogLogo::onRepaint(wxEvent &event) { wxPaintDC dc(this); dc.SetBackgroundMode(wxTRANSPARENT); wxSize size = this->GetSize(); int logo_w = this->logo.GetWidth(); int logo_h = this->logo.GetHeight(); dc.DrawBitmap(this->logo, (size.GetWidth() - logo_w)/2, (size.GetHeight() - logo_h)/2, true); event.Skip(); } AboutDialog::AboutDialog() : DPIDialog(NULL, wxID_ANY, wxString::Format(_(L("About %s")), SLIC3R_APP_NAME), wxDefaultPosition, wxDefaultSize, /*wxCAPTION*/wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { SetFont(wxGetApp().normal_font()); wxColour bgr_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); SetBackgroundColour(bgr_clr); wxBoxSizer* hsizer = new wxBoxSizer(wxHORIZONTAL); auto main_sizer = new wxBoxSizer(wxVERTICAL); main_sizer->Add(hsizer, 0, wxEXPAND | wxALL, 20); // logo m_logo_bitmap = ScalableBitmap(this, "Slic3r_192px.png", 192); m_logo = new wxStaticBitmap(this, wxID_ANY, m_logo_bitmap.bmp()); hsizer->Add(m_logo, 1, wxALIGN_CENTER_VERTICAL); wxBoxSizer* vsizer = new wxBoxSizer(wxVERTICAL); hsizer->Add(vsizer, 2, wxEXPAND|wxLEFT, 20); // title { wxStaticText* title = new wxStaticText(this, wxID_ANY, SLIC3R_APP_NAME, wxDefaultPosition, wxDefaultSize); wxFont title_font = GUI::wxGetApp().bold_font(); title_font.SetFamily(wxFONTFAMILY_ROMAN); title_font.SetPointSize(24); title->SetFont(title_font); vsizer->Add(title, 0, wxALIGN_LEFT | wxTOP, 10); } // version { auto version_string = _(L("Version"))+ " " + std::string(SLIC3R_VERSION); wxStaticText* version = new wxStaticText(this, wxID_ANY, version_string.c_str(), wxDefaultPosition, wxDefaultSize); wxFont version_font = GetFont(); #ifdef __WXMSW__ version_font.SetPointSize(version_font.GetPointSize()-1); #else version_font.SetPointSize(11); #endif version->SetFont(version_font); vsizer->Add(version, 0, wxALIGN_LEFT | wxBOTTOM, 10); } // text m_html = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO/*NEVER*/); { m_html->SetMinSize(wxSize(-1, 16 * wxGetApp().em_unit())); wxFont font = GetFont(); const auto text_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); 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 fs = font.GetPointSize()-1; int size[] = {fs,fs,fs,fs,fs,fs,fs}; m_html->SetFonts(font.GetFaceName(), font.GetFaceName(), size); m_html->SetBorders(2); const auto text = wxString::Format( "" "
" "" "Copyright © 2016-2019 Prusa Research.