| ... | ... | @@ -40,27 +40,20 @@ let desktopProtocolRegistered = false; |
| 40 | 40 | let destructiveMenuIconCache: Electron.NativeImage | null | undefined; |
| 41 | 41 | |
| 42 | 42 | function getDestructiveMenuIcon(): Electron.NativeImage | undefined { |
| 43 | if (process.platform !== "darwin") return undefined; |
| 43 | 44 | if (destructiveMenuIconCache !== undefined) { |
| 44 | 45 | return destructiveMenuIconCache ?? undefined; |
| 45 | 46 | } |
| 46 | 47 | try { |
| 47 | | const icon = |
| 48 | | process.platform === "darwin" |
| 49 | | ? nativeImage.createFromNamedImage("trash").resize({ |
| 50 | | width: 14, |
| 51 | | height: 14, |
| 52 | | }) |
| 53 | | : nativeImage.createFromPath(resolveIconPath("png") ?? "").resize({ |
| 54 | | width: 14, |
| 55 | | height: 14, |
| 56 | | }); |
| 48 | const icon = nativeImage.createFromNamedImage("trash").resize({ |
| 49 | width: 14, |
| 50 | height: 14, |
| 51 | }); |
| 57 | 52 | if (icon.isEmpty()) { |
| 58 | 53 | destructiveMenuIconCache = null; |
| 59 | 54 | return undefined; |
| 60 | 55 | } |
| 61 | | if (process.platform === "darwin") { |
| 62 | | icon.setTemplateImage(true); |
| 63 | | } |
| 56 | icon.setTemplateImage(true); |
| 64 | 57 | destructiveMenuIconCache = icon; |
| 65 | 58 | return icon; |
| 66 | 59 | } catch { |