Skip to content

Commit

Permalink
Adds menus in app on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0 committed May 1, 2018
1 parent 86c587d commit 76b2581
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"homepage": "https://github.com/cosmo0/arcade-manager",
"dependencies": {
"csv": "^2.0.0",
"electron-default-menu": "^1.0.1",
"electron-settings": "^3.1.4",
"follow-redirects": "^1.4.1",
"fs-extra": "^5.0.0",
Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const { Menu, app, shell, BrowserWindow } = electron;
const path = require('path');
const url = require('url');
const defaultMenu = require('electron-default-menu');

// global reference to window so it's not closed
// when garbage collected
Expand All @@ -12,6 +12,9 @@ let mainWindow;
* Creates the main window
*/
function createWindow () {
const menu = defaultMenu(app, shell);
Menu.setApplicationMenu(Menu.buildFromTemplate(menu));

mainWindow = new BrowserWindow({
width: 1280,
height: 720,
Expand Down

0 comments on commit 76b2581

Please sign in to comment.