mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-06 20:10:12 +02:00
Fix macOS tray icon (#1600)
* add 32x32 icon for macOS tray * add 16x16 image * add black/transparent icon
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 645 B |
Binary file not shown.
|
After Width: | Height: | Size: 301 B |
Binary file not shown.
|
After Width: | Height: | Size: 535 B |
+14
-4
@@ -187,10 +187,20 @@ const createWinThumbarButtons = () => {
|
||||
};
|
||||
|
||||
const createTray = () => {
|
||||
tray =
|
||||
isLinux() || isMacOS()
|
||||
? new Tray(getAssetPath('icons/icon.png'))
|
||||
: new Tray(getAssetPath('icons/icon.ico'));
|
||||
let trayIcon: Electron.NativeImage | string;
|
||||
|
||||
if (isMacOS()) {
|
||||
const iconPath = getAssetPath('icons/IconTemplate.png');
|
||||
const icon = nativeImage.createFromPath(iconPath);
|
||||
icon.setTemplateImage(true);
|
||||
trayIcon = icon;
|
||||
} else if (isLinux()) {
|
||||
trayIcon = getAssetPath('icons/icon.png');
|
||||
} else {
|
||||
trayIcon = getAssetPath('icons/icon.ico');
|
||||
}
|
||||
|
||||
tray = new Tray(trayIcon);
|
||||
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user