Skip to content

Commit a7bb4a4

Browse files
committed
Remove app menu bar
1 parent 2a0e54b commit a7bb4a4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

main.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const electron = require('electron');
22
const Auth = require('./controllers/auth');
33
const Tray = require('./controllers/tray');
44
const TaskRunner = require('./controllers/taskRunner');
5+
const localShortcut = require('electron-localshortcut');
56

67
const { app, BrowserWindow, shell } = electron;
78

@@ -27,10 +28,24 @@ const AppWindows = {
2728
this.backgroundProcess = new BrowserWindow({ show: false });
2829
this.mainWindow = new BrowserWindow({ width: 800, height: 600, show: true, icon: `${__dirname}/app.ico` });
2930
this.mainWindow.loadURL(`${__dirname}/views/index.html`);
31+
this.mainWindow.setMenu(null);
3032

33+
this.configureLocalShortcut();
3134
this.bindEventListener();
3235
},
3336

37+
configureLocalShortcut: function configureLocalShortcut() {
38+
const windowToRegister = this.mainWindow;
39+
40+
localShortcut.register(windowToRegister, 'CommandOrControl+R', () => {
41+
this.mainWindow.reload();
42+
});
43+
44+
localShortcut.register(windowToRegister, 'CommandOrControl+Shift+I', () => {
45+
this.mainWindow.toggleDevTools();
46+
});
47+
},
48+
3449
bindEventListener: function bindEventListener() {
3550
const self = this;
3651

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"license": "ISC",
1313
"dependencies": {
1414
"electron": "^1.4.3",
15+
"electron-localshortcut": "^0.6.1",
1516
"jsonwatch": "^1.1.0",
1617
"lodash": "^4.15.0",
1718
"lowdb": "^0.13.1",

0 commit comments

Comments
 (0)