-
Notifications
You must be signed in to change notification settings - Fork 0
/
teste.js
44 lines (35 loc) · 864 Bytes
/
teste.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
const path = require('path')
const { app, Menu, Tray, systemPreferences } = require('electron')
let tray = null
const getIcon = () => {
if (process.platform === 'win32') return '/assets/binanceIcon.png'
// if (systemPreferences.isDarkMode()) return 'icon-light.png'
return '/assets/binanceIcon.png'
}
app.on('ready', () => {
if (app.dock) app.dock.hide()
tray = new Tray(path.join(__dirname, getIcon()))
if (process.platform === 'win32') {
tray.on('click', tray.popUpContextMenu)
}
updateMenu()
tray.setToolTip('Clipmaster')
})
const updateMenu = () => {
const menu = Menu.buildFromTemplate([
{
label: '<p style="font-size: 10px"></p>',
click() {
null
}
},
{ type: 'separator' },
{
label: 'Fechar',
click() {
app.quit()
}
}
])
tray.setContextMenu(menu)
}