Added tray icon
This commit is contained in:
parent
373cc9211c
commit
bf72600daa
1 changed files with 7 additions and 2 deletions
|
@ -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();
|
||||
|
|
Reference in a new issue