mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 16:27:54 -06:00
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 _WIN32
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_DRAG_AND_DROP_GCODE_FILES
|
#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:
|
default:
|
||||||
case GUI_App::EAppMode::Editor:
|
case GUI_App::EAppMode::Editor: { src_path += "\\prusa-slicer.exe"; break; }
|
||||||
{
|
case GUI_App::EAppMode::GCodeViewer: { src_path += "\\prusa-gcodeviewer.exe"; break; }
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
wxIconLocation icon_location;
|
||||||
|
icon_location.SetFileName(src_path);
|
||||||
|
SetIcon(icon_location);
|
||||||
#else
|
#else
|
||||||
TCHAR szExeFileName[MAX_PATH];
|
TCHAR szExeFileName[MAX_PATH];
|
||||||
GetModuleFileName(nullptr, szExeFileName, MAX_PATH);
|
GetModuleFileName(nullptr, szExeFileName, MAX_PATH);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue