fix-build: invisible app icon when there are more files within "build/icons/*.png"

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-10-14 18:12:13 +03:00
1 parent 00f8f030d5
commit 78b199b719
9 files changed
+10 -4

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ export async function generateTrayIcon(
{
outputFilename = "tray_icon", // e.g. output tray_icon_dark@2x.png
svgIconPath = path.resolve(__dirname, "../src/renderer/components/icon/logo-lens.svg"),
outputFolder = path.resolve(__dirname, "./icons"),
outputFolder = path.resolve(__dirname, "./tray"),
dpiSuffix = "2x",
pixelSize = 32,
shouldUseDarkColors = false, // managed by electron.nativeTheme.shouldUseDarkColors
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3 -2
View File
@@ -90,8 +90,9 @@
"filter": "!**/main.js"
},
{
"from": "build/icons/",
"to": "build/icons/"
"from": "build/tray",
"to": "static/icons",
"filter": "*.png"
},
"LICENSE"
],
+6 -1
View File
@@ -10,6 +10,7 @@ import { workspaceStore } from "../common/workspace-store";
import { preferencesURL } from "../renderer/components/+preferences/preferences.route";
import { clusterViewURL } from "../renderer/components/cluster-manager/cluster-view.route";
import logger from "./logger";
import { isDevelopment } from "../common/vars";
// note: instance of Tray should be saved somewhere, otherwise it disappears
export let tray: Tray;
@@ -18,7 +19,11 @@ export let tray: Tray;
nativeTheme.on("updated", () => tray?.setImage(getTrayIcon()));
export function getTrayIcon(isDark = nativeTheme.shouldUseDarkColors): string {
return path.resolve(__static, "../build/icons", `tray_icon${isDark ? "_dark" : ""}.png`)
return path.resolve(
__static,
isDevelopment ? "../build/tray" : "icons", // copied within electron-builder extras
`tray_icon${isDark ? "_dark" : ""}.png`
)
}
export function initTray(windowManager: WindowManager) {