asticode / go-astilectron

Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)
MIT License
4.9k stars 344 forks source link

Notification Icon Path #280

Closed Joe-Improbable closed 3 years ago

Joe-Improbable commented 4 years ago

I'm using Astilectron's notification API to send a notification to the user. However, I'm confused about the Icon field. Is the path provided here meant to be relative to the resources folder similar to Astilectrons.Options AppIconDefaultPath or is it relative to something else.

Example code, which reuses the same icon path as AppIconDefaultPath, which works, but it does not for notification icons:

var notification = asti.NewNotification(&astilectron.NotificationOptions{
        Body:     message,
        HasReply: astikit.BoolPtr(false),
        Icon:     "resources/app/icons/64x64.png",
        Title:    title,
    })
asticode commented 4 years ago

I think paths to notification and tray icons need to be absolute. Check out this logic for that.