1
Fork 0

Added tray icon

This commit is contained in:
Jake Howard 2015-11-04 13:52:57 +00:00
parent 373cc9211c
commit bf72600daa

View file

@ -13,6 +13,7 @@ var menu = new Menu();
Menu.setApplicationMenu(menu); Menu.setApplicationMenu(menu);
var mainWindow = null; var mainWindow = null;
var audioController = null; var audioController = null;
var icon = null;
// Make sure the application closes // Make sure the application closes
app.on('window-all-closed', function () { app.on('window-all-closed', function () {
@ -20,15 +21,19 @@ app.on('window-all-closed', function () {
}); });
app.on('ready', 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({ mainWindow = new BrowserWindow({
width: 800, width: 800,
height: 600, height: 600,
frame: false frame: false
}); });
mainWindow.loadUrl('file://' + __dirname + '/index.html'); mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.toggleDevTools(); mainWindow.toggleDevTools();
mainWindow.on('closed', function() { mainWindow.on('closed', function() {
mainWindow = undefined; mainWindow = undefined;
audioController.close(); audioController.close();