Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions templates/haxe/ApplicationMain.hx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ import ::APP_MAIN::;
}

app.createWindow(attributes);
#if (linux && sys)
var iconPath = lime.system.System.applicationDirectory + "/icon.png";
if (sys.FileSystem.exists(iconPath))
{
var icon = lime.graphics.Image.fromFile(iconPath);
if (icon != null && app.window != null)
{
app.window.setIcon(icon);
}
}
#end
::end::
#elseif air
app.window.title = "::meta.title::";
Expand Down
12 changes: 11 additions & 1 deletion tools/platforms/LinuxPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import lime.tools.AssetType;
import lime.tools.CPPHelper;
import lime.tools.DeploymentHelper;
import lime.tools.HXProject;
import lime.tools.Icon;
import lime.tools.IconHelper;
import lime.tools.JavaHelper;
import lime.tools.NekoHelper;
import lime.tools.NodeJSHelper;
Expand Down Expand Up @@ -627,7 +629,15 @@ class LinuxPlatform extends PlatformTarget
ProjectHelper.recursiveSmartCopyTemplate(project, "cpp/static", targetDirectory + "/obj", context);
}

// context.HAS_ICON = IconHelper.createIcon (project.icons, 256, 256, Path.combine (applicationDirectory, "icon.png"));
var icons = project.icons;

if (icons.length == 0)
{
icons = [new Icon(System.findTemplate(project.templatePaths, "default/icon.svg"))];
}

context.HAS_ICON = IconHelper.createIcon(icons, 256, 256, Path.combine(applicationDirectory, "icon.png"));

for (asset in project.assets)
{
var path = Path.combine(applicationDirectory, asset.targetPath);
Expand Down
Loading