Skip to content

Commit

Permalink
SDA-1857 - Add accelerator for zoom in for MacOS (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
KiranNiranjan committed Mar 12, 2020
1 parent a114fd9 commit 81ad1c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/app-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const windowsAccelerator = Object.assign({
zoomOut: 'Ctrl+-',
});

const macAccelerator = Object.assign({
zoomIn: 'CommandOrControl+=',
});

let {
minimizeOnClose,
launchOnStartup,
Expand Down Expand Up @@ -490,10 +494,15 @@ export class AppMenu {
*/
private assignRoleOrLabel({ role, label }: MenuItemConstructorOptions): MenuItemConstructorOptions {
logger.info(`app-menu: assigning role & label respectively for ${role} & ${label}`);
if (isMac || isLinux) {
if (isLinux) {
return label ? { role, label } : { role };
}

if (isMac) {
return label ? { role, label, accelerator: role ? macAccelerator[ role ] : '' }
: { role, accelerator: role ? macAccelerator[ role ] : '' };
}

if (isWindowsOS) {
return label ? { role, label, accelerator: role ? windowsAccelerator[ role ] : '' }
: { role, accelerator: role ? windowsAccelerator[ role ] : '' };
Expand Down

0 comments on commit 81ad1c5

Please sign in to comment.