mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Using trayTemplate icon
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
832f29f666
commit
c8827e3342
BIN
build/tray/trayTemplate.png
Normal file
BIN
build/tray/trayTemplate.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 448 B |
BIN
build/tray/trayTemplate@2x.png
Normal file
BIN
build/tray/trayTemplate@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 973 B |
BIN
build/tray/trayTemplate@3x.png
Normal file
BIN
build/tray/trayTemplate@3x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@ -16,14 +16,11 @@ import { exitApp } from "./exit-app";
|
|||||||
// 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;
|
||||||
|
|
||||||
// refresh icon when MacOS dark/light theme has changed
|
export function getTrayIcon(): string {
|
||||||
nativeTheme?.on("updated", () => tray?.setImage(getTrayIcon()));
|
|
||||||
|
|
||||||
export function getTrayIcon(isDark = nativeTheme.shouldUseDarkColors): string {
|
|
||||||
return path.resolve(
|
return path.resolve(
|
||||||
__static,
|
__static,
|
||||||
isDevelopment ? "../build/tray" : "icons", // copied within electron-builder extras
|
isDevelopment ? "../build/tray" : "icons", // copied within electron-builder extras
|
||||||
`tray_icon${isDark ? "_dark" : ""}.png`
|
"trayTemplate.png"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user