Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix trayMenu icon

Stanimire129fef7d92a
diff --git a/app/electron-tray-menu.ts b/app/electron-tray-menu.ts
index 6d791397d..6a6bcbc31 100644
--- a/app/electron-tray-menu.ts
+++ b/app/electron-tray-menu.ts
@@ -17,14 +17,18 @@
*/
import { app, Menu, Tray } from 'electron';
-import pathLib from 'path';
// import TrayIcon2x from '-/assets/icons/[email protected]';
// import TrayIcon from '-/assets/icons/trayIcon.png';
// import TrayIcon3x from '-/assets/icons/[email protected]';
let tray = null;
-export default function buildTrayIconMenu(mainPageProps: any, i18n, isMacLike) {
+export default function buildTrayIconMenu(
+ mainPageProps: any,
+ i18n,
+ isMacLike,
+ iconPath
+) {
const cKey = isMacLike ? ' - Cmd' : ' - Ctrl';
function openNextFile() {
@@ -106,9 +110,7 @@ export default function buildTrayIconMenu(mainPageProps: any, i18n, isMacLike) {
// const tray = new Tray(nImage);
if (!tray) {
- tray = new Tray(
- pathLib.resolve(__dirname, 'assets', 'icons', '[email protected]')
- );
+ tray = new Tray(iconPath);
}
/* tray.on('click', () => {
mainPageProps.showTagSpaces();
diff --git a/app/main.dev.ts b/app/main.dev.ts
index e7803805a..d060a69ed 100644
--- a/app/main.dev.ts
+++ b/app/main.dev.ts
@@ -291,6 +291,18 @@ function reloadApp() {
}
function buildTrayMenu() {
+ let iconPath;
+ if (devMode) {
+ iconPath = path.resolve(__dirname, 'assets', 'icons', '[email protected]');
+ } else {
+ iconPath = path.resolve(
+ process.resourcesPath,
+ 'app.asar',
+ 'assets',
+ 'icons',
+ );
+ }
buildTrayIconMenu(
{
showTagSpaces,
@@ -302,7 +314,8 @@ function buildTrayMenu() {
quitApp: reloadApp
},
i18n,
- isMac
+ isMac,
+ iconPath
);
}
diff --git a/resources/builder.json b/resources/builder.json
index c925e811e..0579d0aed 100644
--- a/resources/builder.json
+++ b/resources/builder.json
@@ -3,6 +3,7 @@
"asar": true,
"files": [
"dist/",
+ "assets/icons/[email protected]",
"node_modules/",
"app.html",
"splash.html",