<commit_before>#include "AboutDialog.hpp"

namespace Slic3r { namespace GUI {

static void link_clicked(wxHtmlLinkEvent& e)
{
    wxLaunchDefaultBrowser(e.GetLinkInfo().GetHref());
    e.Skip(0);
}

AboutDialog::AboutDialog(wxWindow* parent) : wxDialog(parent, -1, _("About Slic3r"), wxDefaultPosition, wxSize(600, 460), wxCAPTION)
{ 
        auto hsizer { new wxBoxSizer(wxHORIZONTAL) } ;

        auto vsizer { new wxBoxSizer(wxVERTICAL) } ;

        // logo
        auto logo { new AboutDialogLogo(this) };
        hsizer->Add(logo, 0, wxEXPAND | wxLEFT | wxRIGHT, 30);

        // title
        auto title { new wxStaticText(this, -1, "Slic3r", wxDefaultPosition, wxDefaultSize) };
        auto title_font { wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) };

        title_font.SetWeight(wxFONTWEIGHT_BOLD);
        title_font.SetFamily(wxFONTFAMILY_ROMAN);
        title_font.SetPointSize(24);
        title->SetFont(title_font);

        vsizer->Add(title, 0, wxALIGN_LEFT | wxTOP, 30);

        // version
        
        auto version {new wxStaticText(this, -1, wxString("Version ") + wxString(SLIC3R_VERSION), wxDefaultPosition, wxDefaultSize) };
        auto version_font { wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) };
        version_font.SetPointSize((the_os == OS::Windows ? 9 : 11));
        version->SetFont(version_font);
        vsizer->Add(version, 0, wxALIGN_LEFT | wxBOTTOM, 10);

        // text

        wxString text {""};
        text << "<html>"
            << "<body>"
            << "Copyright &copy; 2011-2017 <NAME>. <br />" 
            << "<a href=\"http://slic3r.org/\">Slic3r</a> is licensed under the "
            << "<a href=\"http://www.gnu.org/licenses/agpl-3.0.html\">GNU Affero General Public License, version 3</a>."
            << "<br /><br /><br />"
            << "Contributions by <NAME>, <NAME>, <NAME>, <NAME>, "
            << "<NAME>, <NAME>, <NAME>, <NAME>, <NAME> and numerous others. "
            << "Manual by <NAME>. Inspired by the RepRap community. <br />"
            << "Slic3r logo designed by <NAME>, <a href=\"http://www.famfamfam.com/lab/icons/silk/\">Silk Icon Set</a> designed by <NAME>. "
            << "<br /><br />"
            << "Built on " << build_date << " at git version " << git_version << "."
            << "</body>"
            << "</html>";
        auto html {new wxHtmlWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_NEVER)};
        html->SetBorders(2);
        html->SetPage(text);

        html->Bind(wxEVT_HTML_LINK_CLICKED, [=](wxHtmlLinkEvent& e){ link_clicked(e); });

        vsizer->Add(html, 1, wxEXPAND | wxALIGN_LEFT | wxRIGHT | wxBOTTOM, 20);
        // buttons
        auto buttons = this->CreateStdDialogButtonSizer(wxOK);
        this->SetEscapeId(wxID_CLOSE);

        vsizer->Add(buttons, 0, wxEXPAND | wxRIGHT | wxBOTTOM, 3);

        hsizer->Add(vsizer, 1, wxEXPAND, 0);
        this->SetSizer(hsizer);

    };

AboutDialogLogo::AboutDialogLogo(wxWindow* parent) : 
    wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize) 
{ 
    this->logo = wxBitmap(var("Slic3r_192px.png"), wxBITMAP_TYPE_PNG);
    this->SetMinSize(wxSize(this->logo.GetWidth(), this->logo.GetHeight()));

    this->Bind(wxEVT_PAINT, [=](wxPaintEvent& e) { this->repaint(e);});
}

void AboutDialogLogo::repaint(wxPaintEvent& event)
{
    auto dc { new wxPaintDC(this) };

    dc->SetBackgroundMode(wxPENSTYLE_TRANSPARENT);<commit_msg>Avoid gcc interpreting things as initializer lists.<commit_after>#include "AboutDialog.hpp"

namespace Slic3r { namespace GUI {

static void link_clicked(wxHtmlLinkEvent& e)
{
    wxLaunchDefaultBrowser(e.GetLinkInfo().GetHref());
    e.Skip(0);
}

AboutDialog::AboutDialog(wxWindow* parent) : wxDialog(parent, -1, _("About Slic3r"), wxDefaultPosition, wxSize(600, 460), wxCAPTION)
{ 
        auto hsizer = new wxBoxSizer(wxHORIZONTAL) ;

        auto vsizer = new wxBoxSizer(wxVERTICAL) ;

        // logo
        auto logo = new AboutDialogLogo(this);
        hsizer->Add(logo, 0, wxEXPAND | wxLEFT | wxRIGHT, 30);

        // title
        auto title = new wxStaticText(this, -1, "Slic3r", wxDefaultPosition, wxDefaultSize);
        auto title_font { wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) };

        title_font.SetWeight(wxFONTWEIGHT_BOLD);
        title_font.SetFamily(wxFONTFAMILY_ROMAN);
        title_font.SetPointSize(24);
        title->SetFont(title_font);

        vsizer->Add(title, 0, wxALIGN_LEFT | wxTOP, 30);

        // version
        
        auto version = new wxStaticText(this, -1, wxString("Version ") + wxString(SLIC3R_VERSION), wxDefaultPosition, wxDefaultSize);
        auto version_font { wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) };
        version_font.SetPointSize((the_os == OS::Windows ? 9 : 11));
        version->SetFont(version_font);
        vsizer->Add(version, 0, wxALIGN_LEFT | wxBOTTOM, 10);

        // text

        wxString text {""};
        text << "<html>"
            << "<body>"
            << "Copyright &copy; 2011-2017 <NAME>. <br />" 
            << "<a href=\"http://slic3r.org/\">Slic3r</a> is licensed under the "
            << "<a href=\"http://www.gnu.org/licenses/agpl-3.0.html\">GNU Affero General Public License, version 3</a>."
            << "<br /><br /><br />"
            << "Contributions by <NAME>, <NAME>, <NAME>, <NAME>, "
            << "<NAME>, <NAME>, <NAME>, <NAME>, <NAME> and numerous others. "
            << "Manual by <NAME>. Inspired by the RepRap community. <br />"
            << "Slic3r logo designed by <NAME>, <a href=\"http://www.famfamfam.com/lab/icons/silk/\">Silk Icon Set</a> designed by <NAME>. "
            << "<br /><br />"
            << "Built on " << build_date << " at git version " << git_version << "."
            << "</body>"
            << "</html>";
        auto html = new wxHtmlWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_NEVER);
        html->SetBorders(2);
        html->SetPage(text);

        html->Bind(wxEVT_HTML_LINK_CLICKED, [=](wxHtmlLinkEvent& e){ link_clicked(e); });

        vsizer->Add(html, 1, wxEXPAND | wxALIGN_LEFT | wxRIGHT | wxBOTTOM, 20);
        // buttons
        auto buttons = this->CreateStdDialogButtonSizer(wxOK);
        this->SetEscapeId(wxID_CLOSE);

        vsizer->Add(buttons, 0, wxEXPAND | wxRIGHT | wxBOTTOM, 3);

        hsizer->Add(vsizer, 1, wxEXPAND, 0);
        this->SetSizer(hsizer);

    };

AboutDialogLogo::AboutDialogLogo(wxWindow* parent) : 
    wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize) 
{ 
    this->logo = wxBitmap(var("Slic3r_192px.png"), wxBITMAP_TYPE_PNG);
    this->SetMinSize(wxSize(this->logo.GetWidth(), this->logo.GetHeight()));

    this->Bind(wxEVT_PAINT, [=](wxPaintEvent& e) { this->repaint(e);});
}

void AboutDialogLogo::repaint(wxPaintEvent& event)
{
    auto dc { new wxPaintDC(this) };

    dc->SetBackgroundMode(wxPENSTYLE_TRANSPARENT);
{'fraction_non_alphanumeric': 0.1577574967405476, 'fraction_numerical': 0.01622482978415182, 'mean_word_length': 2.8939650310208687, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 105, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4704073', 'n_tokens_mistral': 2424, 'n_tokens_neox': 2286, 'n_words': 443}