From a9f52955a0b16618c97a857fdf4e4ad092691ffa Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 24 Sep 2018 14:27:03 +0200 Subject: [PATCH] Fixed app icon on Windows --- src/slic3r/GUI/MainFrame.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 270320f391..6aefb93851 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -33,14 +33,16 @@ wxFrame(NULL, wxID_ANY, SLIC3R_BUILD, wxDefaultPosition, wxDefaultSize, wxDEFAUL // Slic3r::GUI::set_main_frame(this); m_appController = new Slic3r::AppController(); -// #if _WIN32 -// // Load the icon either from the exe, or from the ico file. -// // auto iconfile = Slic3r::decode_path($FindBin::Bin) . '\slic3r.exe'; -// auto iconfile = Slic3r::var("Slic3r.ico");// unless - f iconfile; -// SetIcon(wxIcon(iconfile, wxBITMAP_TYPE_ICO)); -// #else + // Load the icon either from the exe, or from the ico file. +#if _WIN32 + { + TCHAR szExeFileName[MAX_PATH]; + GetModuleFileName(nullptr, szExeFileName, MAX_PATH); + SetIcon(wxIcon(szExeFileName, wxBITMAP_TYPE_ICO)); + } +#else SetIcon(wxIcon(Slic3r::var("Slic3r_128px.png"), wxBITMAP_TYPE_PNG)); -// #ifdef // _WIN32 +#endif // _WIN32 // initialize tabpanel and menubar init_tabpanel();