diff --git a/src/main.js b/src/main.js index 6168add..3b5ce7b 100644 --- a/src/main.js +++ b/src/main.js @@ -13,6 +13,7 @@ var menu = new Menu(); Menu.setApplicationMenu(menu); var mainWindow = null; var audioController = null; +var icon = null; // Make sure the application closes app.on('window-all-closed', function () { @@ -20,15 +21,19 @@ app.on('window-all-closed', function () { }); app.on('ready', function () { + icon = new Tray(null); + icon.setToolTip('Keyboard Mechanizer | Click to show'); + icon.on('click', function () { + mainWindow.show(); + }); + mainWindow = new BrowserWindow({ width: 800, height: 600, frame: false }); mainWindow.loadUrl('file://' + __dirname + '/index.html'); - mainWindow.toggleDevTools(); - mainWindow.on('closed', function() { mainWindow = undefined; audioController.close();