Add icon for Editor on Linux

This commit is contained in:
2021-01-17 22:14:16 +01:00
parent fcc4b371b9
commit 1943de62e9
2 changed files with 28 additions and 1 deletions
+26 -1
View File
@@ -19,6 +19,9 @@
#include "Engine/Engine/Engine.h"
#include "Engine/ShadowsOfMordor/Builder.h"
#include "FlaxEngine.Gen.h"
#if PLATFORM_LINUX
#include "Engine/Tools/TextureTool/TextureTool.h"
#endif
namespace EditorImpl
{
@@ -480,7 +483,29 @@ int32 Editor::LoadProduct()
Window* Editor::CreateMainWindow()
{
return Managed->GetMainWindow();
Window* window = Managed->GetMainWindow();
#if PLATFORM_LINUX
// Set window icon
const String iconPath = Globals::BinariesFolder / TEXT("Logo.png");
if (FileSystem::FileExists(iconPath))
{
TextureData icon;
if (TextureTool::ImportTexture(iconPath, icon))
{
LOG(Warning, "Failed to load icon file.");
}
else
{
window->SetIcon(icon);
}
}
else
{
LOG(Warning, "Missing icon file.");
}
#endif
return window;
}
bool Editor::Init()