From b8ae738621331fb292e332c0a01400058566f234 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 5 May 2018 11:36:36 -0400 Subject: [PATCH] fixes for macos --- src/locales/en/messages.json | 4 ++++ src/main/tray.main.ts | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index d8e0642f5f..7144ad4359 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -1046,5 +1046,9 @@ }, "exit": { "message": "Exit" + }, + "showHide": { + "message": "Show / Hide", + "description": "Text for a button that toggles the visibility of the window. Shows the window when it is hidden or hides the window if it is currently open." } } diff --git a/src/main/tray.main.ts b/src/main/tray.main.ts index adb16f8665..b2ea03d716 100644 --- a/src/main/tray.main.ts +++ b/src/main/tray.main.ts @@ -35,12 +35,12 @@ export class TrayMain { async init(additionalMenuItems: MenuItemConstructorOptions[] = null) { const menuItemOptions: MenuItemConstructorOptions[] = [{ - label: this.appName, + label: this.i18nService.t('showHide'), click: () => this.toggleWindow(), }, { type: 'separator' }, { - label: this.i18nService.t('exit'), + label: process.platform === 'darwin' ? this.i18nService.t('close') : this.i18nService.t('exit'), click: () => this.closeWindow(), }]; @@ -56,14 +56,14 @@ export class TrayMain { this.windowMain.win.on('minimize', async (e: Event) => { if (await this.storageService.get(ElectronConstants.enableMinimizeToTrayKey)) { e.preventDefault(); - await this.hideToTray(); + this.hideToTray(); } }); this.windowMain.win.on('show', async (e: Event) => { const enableTray = await this.storageService.get(ElectronConstants.enableTrayKey); if (!enableTray) { - await this.removeTray(false); + this.removeTray(false); } }); }