1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

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 2020-10-14 18:08:10 +03:00
parent 00f8f030d5
commit 78b199b719
9 changed files with 10 additions and 4 deletions

View File

@ -9,7 +9,7 @@ export async function generateTrayIcon(
{ {
outputFilename = "tray_icon", // e.g. output tray_icon_dark@2x.png outputFilename = "tray_icon", // e.g. output tray_icon_dark@2x.png
svgIconPath = path.resolve(__dirname, "../src/renderer/components/icon/logo-lens.svg"), svgIconPath = path.resolve(__dirname, "../src/renderer/components/icon/logo-lens.svg"),
outputFolder = path.resolve(__dirname, "./icons"), outputFolder = path.resolve(__dirname, "./tray"),
dpiSuffix = "2x", dpiSuffix = "2x",
pixelSize = 32, pixelSize = 32,
shouldUseDarkColors = false, // managed by electron.nativeTheme.shouldUseDarkColors shouldUseDarkColors = false, // managed by electron.nativeTheme.shouldUseDarkColors

View File

Before

Width:  |  Height:  |  Size: 448 B

After

Width:  |  Height:  |  Size: 448 B

View File

Before

Width:  |  Height:  |  Size: 973 B

After

Width:  |  Height:  |  Size: 973 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 478 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -90,8 +90,9 @@
"filter": "!**/main.js" "filter": "!**/main.js"
}, },
{ {
"from": "build/icons/", "from": "build/tray",
"to": "build/icons/" "to": "static/icons",
"filter": "*.png"
}, },
"LICENSE" "LICENSE"
], ],

View File

@ -10,6 +10,7 @@ import { workspaceStore } from "../common/workspace-store";
import { preferencesURL } from "../renderer/components/+preferences/preferences.route"; import { preferencesURL } from "../renderer/components/+preferences/preferences.route";
import { clusterViewURL } from "../renderer/components/cluster-manager/cluster-view.route"; import { clusterViewURL } from "../renderer/components/cluster-manager/cluster-view.route";
import logger from "./logger"; import logger from "./logger";
import { isDevelopment } from "../common/vars";
// note: instance of Tray should be saved somewhere, otherwise it disappears // note: instance of Tray should be saved somewhere, otherwise it disappears
export let tray: Tray; export let tray: Tray;
@ -18,7 +19,11 @@ export let tray: Tray;
nativeTheme.on("updated", () => tray?.setImage(getTrayIcon())); nativeTheme.on("updated", () => tray?.setImage(getTrayIcon()));
export function getTrayIcon(isDark = nativeTheme.shouldUseDarkColors): string { 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) { export function initTray(windowManager: WindowManager) {