Load tray icon image via path.join
This commit is contained in:
parent
33297c118f
commit
3b953148c7
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
const { BrowserWindow, Tray } = require('electron')
|
const { BrowserWindow, Tray } = require('electron')
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
let trayServiceWindow = null
|
let trayServiceWindow = null
|
||||||
let tray = null
|
let tray = null
|
||||||
|
|
||||||
|
@ -11,7 +13,7 @@ let trayService = {}
|
||||||
|
|
||||||
trayService.initTray = (window) => {
|
trayService.initTray = (window) => {
|
||||||
trayServiceWindow = window
|
trayServiceWindow = window
|
||||||
let iconPath = __dirname + '/../resources/images/icon.png'
|
let iconPath = path.join(__dirname, '/../resources/images/icon.png')
|
||||||
tray = new Tray(iconPath)
|
tray = new Tray(iconPath)
|
||||||
tray.setToolTip('Chimeverse')
|
tray.setToolTip('Chimeverse')
|
||||||
tray.on('click', function() {
|
tray.on('click', function() {
|
||||||
|
@ -24,11 +26,11 @@ trayService.initTray = (window) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
trayService.showEnvelope = () => {
|
trayService.showEnvelope = () => {
|
||||||
tray.setImage(__dirname + '/../resources/images/envelope.png')
|
tray.setImage(path.join(__dirname, '/../resources/images/envelope.png'))
|
||||||
}
|
}
|
||||||
|
|
||||||
trayService.hideEnvelope = () => {
|
trayService.hideEnvelope = () => {
|
||||||
tray.setImage(__dirname + '/../resources/images/icon.png')
|
tray.setImage(path.join(__dirname, '/../resources/images/icon.png'))
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = trayService
|
module.exports = trayService
|
||||||
|
|
Loading…
Reference in New Issue