This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
66 lines (58 loc) · 1.54 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'use strict';
var app = require('app');
var BrowserWindow = require('browser-window');
var Menu = require('menu');
var Tray = require('tray');
var mainWindow = null;
var appIcon = null;
app.on('ready', function(){
Menu.setApplicationMenu(menu);
mainWindow = new BrowserWindow({show:false});
//mainWindow = new BrowserWindow({show:true});
mainWindow.loadUrl('file://' + __dirname + '/index.html');
appIcon = new Tray(__dirname + '/icon.png');
app.dock.hide()
var contextMenu = Menu.buildFromTemplate([
{
label: 'Quit',
accelerator: 'Command+Q',
click: function() { app.quit(); }
},
]);
appIcon.setToolTip('GitHub Notification Electron');
appIcon.setContextMenu(contextMenu);
});
var template = [
{
label: 'View',
submenu: [
{
label: 'Quit',
accelerator: 'Command+Q',
click: function() { app.quit(); }
},
//{
// label: 'Reload',
// accelerator: 'CmdOrCtrl+R',
// click: function(item, focusedWindow) {
// if (focusedWindow)
// focusedWindow.reload();
// }
//},
//{
// label: 'Toggle Developer Tools',
// accelerator: (function() {
// if (process.platform == 'darwin')
// return 'Alt+Command+I';
// else
// return 'Ctrl+Shift+I';
// })(),
// click: function(item, focusedWindow) {
// if (focusedWindow)
// focusedWindow.toggleDevTools();
// }
//},
]
},
];
var menu = Menu.buildFromTemplate(template);