Skip to content
Merged
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 Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Not released

# 5.22.14

ElectronNET.CLI:

* Fixed bug: Electron tray icon TypeError ([Electron original issue](https://github.com/electron/electron/issues/7657))
* Fixed bug: Wrong tray icon path in the application built via `electronize build` command

ElectronNET.WebApp:

* Fixed usage of the `Electron.Tray.Show` according fixed bugs in the ElectronNET.CLI


# Released

Expand Down
4 changes: 2 additions & 2 deletions ElectronNET.Host/api/tray.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ElectronNET.Host/api/tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export = (socket: SocketIO.Socket) => {
electronSocket.emit('trayMenuItemClicked', id);
});

const imagePath = path.join(__dirname.replace('api', ''), 'bin', image);
const trayIcon = nativeImage.createFromPath(image);

tray = new Tray(imagePath);
tray = new Tray(trayIcon);
tray.setContextMenu(menu);
});

Expand Down
14 changes: 12 additions & 2 deletions ElectronNET.WebApp/Controllers/TrayController.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
using Microsoft.AspNetCore.Mvc;
using System.IO;
using Microsoft.AspNetCore.Mvc;
using ElectronNET.API;
using ElectronNET.API.Entities;
using Microsoft.AspNetCore.Hosting;

namespace ElectronNET.WebApp.Controllers
{
public class TrayController : Controller
{
private readonly IHostingEnvironment _env;

public TrayController(IHostingEnvironment env)
{
_env = env;
}


public IActionResult Index()
{
if (HybridSupport.IsElectronActive)
Expand All @@ -21,7 +31,7 @@ public IActionResult Index()
Click = () => Electron.Tray.Destroy()
};

Electron.Tray.Show("/Assets/electron_32x32.png", menu);
Electron.Tray.Show(Path.Combine(_env.ContentRootPath, "Assets/electron_32x32.png"), menu);
Electron.Tray.SetToolTip("Electron Demo in the tray.");
}
else
Expand Down
1 change: 0 additions & 1 deletion ElectronNET.WebApp/ElectronNET.WebApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<Content Remove="Views\Windows\HandleErrorCrashes.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Assets\" />
<Folder Include="wwwroot\assets\" />
</ItemGroup>
<ItemGroup>
Expand Down