diff options
Diffstat (limited to 'gui/src/main')
| -rw-r--r-- | gui/src/main/index.ts | 7 | ||||
| -rw-r--r-- | gui/src/main/tray-icon-controller.ts | 22 |
2 files changed, 11 insertions, 18 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 6663a5574e..4df3b4c7a2 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -319,7 +319,7 @@ class ApplicationMain { const trayIconController = new TrayIconController( tray, 'unsecured', - process.platform === 'darwin' && this.guiSettings.monochromaticIcon, + this.guiSettings.monochromaticIcon, ); this.registerWindowListener(windowController); @@ -330,10 +330,7 @@ class ApplicationMain { this.trayIconController = trayIconController; this.guiSettings.onChange = (newState, oldState) => { - if ( - process.platform === 'darwin' && - oldState.monochromaticIcon !== newState.monochromaticIcon - ) { + if (oldState.monochromaticIcon !== newState.monochromaticIcon) { if (this.trayIconController) { this.trayIconController.useMonochromaticIcon = newState.monochromaticIcon; } diff --git a/gui/src/main/tray-icon-controller.ts b/gui/src/main/tray-icon-controller.ts index f4f3925f75..bb1d4f5868 100644 --- a/gui/src/main/tray-icon-controller.ts +++ b/gui/src/main/tray-icon-controller.ts @@ -58,23 +58,19 @@ export default class TrayIconController { } private loadImages() { - const basePath = path.resolve(path.join(__dirname, '../../assets/images/menubar icons')); const frames = Array.from({ length: 10 }, (_, i) => i + 1); - - const suffix = this.imageSuffix(); - const extension = process.platform === 'win32' ? 'ico' : 'png'; - - this.iconImages = frames.map((frame) => - nativeImage.createFromPath(path.join(basePath, `lock-${frame}${suffix}.${extension}`)), - ); + this.iconImages = frames.map((frame) => nativeImage.createFromPath(this.getImagePath(frame))); } - private imageSuffix() { - if (this.useMonochromaticIconValue && process.platform === 'darwin') { - return 'Template'; - } else { - return ''; + private getImagePath(frame: number) { + const basePath = path.resolve(path.join(__dirname, '../../assets/images/menubar icons')); + const extension = process.platform === 'win32' ? 'ico' : 'png'; + let suffix = ''; + if (this.useMonochromaticIconValue) { + suffix = process.platform === 'darwin' ? 'Template' : '_white'; } + + return path.join(basePath, process.platform, `lock-${frame}${suffix}.${extension}`); } private targetFrame(): number { |
