Skip to content

Commit

Permalink
Hide menubar
Browse files Browse the repository at this point in the history
  • Loading branch information
talyguryn committed Jan 15, 2021
1 parent 7a76f76 commit 9a26388
Showing 1 changed file with 40 additions and 3 deletions.
43 changes: 40 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const path = require('path');
const fs = require('fs');
const logger = require('./app/utils/logger');
const { app, BrowserWindow } = require('electron')
const { app, BrowserWindow, Menu } = require('electron')

const IS_DEV = require('electron-is-dev');

@@ -17,6 +15,45 @@ async function createWindow () {

const win = new BrowserWindow(windowOptions)

const menuBar = Menu.buildFromTemplate([{
label: app.getName(),
submenu: [
{
label: 'About ' + app.getName(),
role: 'about'
},
{
type: 'separator'
},
{
label: 'Hide ' + app.getName(),
accelerator: 'Command+H',
role: 'hide'
},
{
label: 'Hide Others',
accelerator: 'Command+Shift+H',
role: 'hideothers'
},
{
label: 'Show All',
role: 'unhide'
},
{
type: 'separator'
}, {
label: 'Quit',
accelerator: 'CmdOrCtrl+Q',
click: function () {
app.quit();
}
}
],
}]
);

Menu.setApplicationMenu(menuBar);

win.loadFile('index.html');

if (IS_DEV) {

0 comments on commit 9a26388

Please sign in to comment.