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);
|
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();
|
||||||
|
|
Reference in a new issue