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