Merge pull request #114 from ente-io/macos-tray-icon
Use a template task bar icon on macOS
This commit is contained in:
commit
469b509b13
BIN
build/taskbar-icon-Template.png
Normal file
BIN
build/taskbar-icon-Template.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 989 B |
BIN
build/taskbar-icon-Template@2x.png
Normal file
BIN
build/taskbar-icon-Template@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
build/taskbar-icon-Template@3x.png
Normal file
BIN
build/taskbar-icon-Template@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 607 B |
|
@ -22,9 +22,13 @@ export function handleUpdates(mainWindow: BrowserWindow) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export function setupTrayItem(mainWindow: BrowserWindow) {
|
export function setupTrayItem(mainWindow: BrowserWindow) {
|
||||||
const trayImgPath = isDev
|
const iconName = isPlatformMac
|
||||||
? 'build/taskbar-icon.png'
|
? 'taskbar-icon-Template.png'
|
||||||
: path.join(process.resourcesPath, 'taskbar-icon.png');
|
: 'taskbar-icon.png';
|
||||||
|
const trayImgPath = path.join(
|
||||||
|
isDev ? 'build' : process.resourcesPath,
|
||||||
|
iconName
|
||||||
|
);
|
||||||
const trayIcon = nativeImage.createFromPath(trayImgPath);
|
const trayIcon = nativeImage.createFromPath(trayImgPath);
|
||||||
const tray = new Tray(trayIcon);
|
const tray = new Tray(trayIcon);
|
||||||
tray.setToolTip('ente');
|
tray.setToolTip('ente');
|
||||||
|
|
Loading…
Reference in a new issue