-
Notifications
You must be signed in to change notification settings - Fork 25
/
index.js
38 lines (33 loc) · 941 Bytes
/
index.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
'use strict';
const electron = require('electron');
var menubar = require('menubar');
var mb = menubar({index:"https://mail.google.com/mail/mu/", tooltip: "Correo", icon:__dirname + "/res/icon.png", width:360, height:640});
const contextMenu = electron.Menu.buildFromTemplate([
{
label: 'About',
click() {
electron.dialog.showMessageBox({title: "Correo", type:"info", message: "A menubar/taskbar Gmail App \nMIT Copyright (c) 2016 Amit Merchant <bullredeyes@gmail.com>", buttons: ["Close"] });
}
},
{
label: 'Website',
click() {
electron.shell.openExternal("https://github.com/amitmerchant1990/correo");
}
},
{
type: 'separator'
},
{
label: 'Quit',
click() {
mb.app.quit();
}
}
]);
mb.on('ready', function ready () {
console.log('Correo is ready to serve in the menubar.');
if (process.platform == 'win32') {
mb.tray.setContextMenu(contextMenu);
}
});