Skip to content

Commit

Permalink
Window Hiding in Mac + a bunch of other keymaps. (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkim205 authored May 22, 2020
1 parent 12f6e63 commit 66362b7
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const openAboutWindow = require("about-window").default;

const appInfo = require("../../package.json");
const config = require("../helpers/config");
const store = require("../helpers/store")
const store = require("../helpers/store");
const {
CONSTANTS: { OS_PLATFORMS, THEME_OPTIONS },
} = require("../helpers/util");
Expand Down Expand Up @@ -50,6 +50,12 @@ const template = [
submenu: [
{ label: `About ${appInfo.productName}`, click: about },
{ type: "separator" },
{ role: "services" },
{ type: "separator" },
{ role: "hide" },
{ role: "hideothers" },
{ role: "unhide" },
{ type: "separator" },
{ label: "Quit", accelerator: "CmdOrCtrl+Q", role: "quit" },
],
},
Expand Down Expand Up @@ -78,13 +84,36 @@ const template = [
{ role: "zoomIn" },
{ role: "zoomOut" },
{ role: "resetZoom" },
{ type: "separator" },
{
label: "Toggle Dark Mode",
accelerator: "CmdOrCtrl+T",
click: toggleDarkMode,
},
],
},
{
label: "Window",
submenu: [
{ role: "minimize" },
{ role: "zoom" },
...(config.osPlatform === OS_PLATFORMS.MAC_OS
? [{ role: "front" }]
: [{ role: "close" }]),
],
},
{
role: "help",
submenu: [
{
label: "Learn More",
click: async () => {
const { shell } = require("electron");
await shell.openExternal(appInfo.repository.url);
},
},
],
},
];

if (config.isDev) {
Expand Down

0 comments on commit 66362b7

Please sign in to comment.