Extract icon from executable files on Windows
This commit is contained in:
parent
482a58ccdc
commit
7630be6cf1
1 changed files with 8 additions and 12 deletions
|
@ -114,20 +114,16 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
|||
#if _WIN32
|
||||
{
|
||||
#if ENABLE_GCODE_DRAG_AND_DROP_GCODE_FILES
|
||||
switch (wxGetApp().get_app_mode())
|
||||
{
|
||||
wxString src_path;
|
||||
wxFileName::SplitPath(wxStandardPaths::Get().GetExecutablePath(), &src_path, nullptr, nullptr, wxPATH_NATIVE);
|
||||
switch (wxGetApp().get_app_mode()) {
|
||||
default:
|
||||
case GUI_App::EAppMode::Editor:
|
||||
{
|
||||
SetIcon(wxIcon(Slic3r::var("PrusaSlicer.ico"), wxBITMAP_TYPE_ICO));
|
||||
break;
|
||||
}
|
||||
case GUI_App::EAppMode::GCodeViewer:
|
||||
{
|
||||
SetIcon(wxIcon(Slic3r::var("PrusaSlicer-gcodeviewer.ico"), wxBITMAP_TYPE_ICO));
|
||||
break;
|
||||
}
|
||||
case GUI_App::EAppMode::Editor: { src_path += "\\prusa-slicer.exe"; break; }
|
||||
case GUI_App::EAppMode::GCodeViewer: { src_path += "\\prusa-gcodeviewer.exe"; break; }
|
||||
}
|
||||
wxIconLocation icon_location;
|
||||
icon_location.SetFileName(src_path);
|
||||
SetIcon(icon_location);
|
||||
#else
|
||||
TCHAR szExeFileName[MAX_PATH];
|
||||
GetModuleFileName(nullptr, szExeFileName, MAX_PATH);
|
||||
|
|
Loading…
Reference in a new issue