-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
41 lines (35 loc) · 1.08 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
const TrayWindow = require('./js/index')
const { ipcMain, Tray, app, BrowserWindow, Menu } = require('electron')
const path = require('path')
const url = require('url')
// ========
// app.commandLine.appendSwitch('disable-gpu')
// app.commandLine.appendArgument('disable-gpu')
app.on('ready', () => {
var timeout = 10
if (process.platform === 'linux') {
console.log(process.platform)
timeout = 200
}
setTimeout(function () {
TrayWindow.setOptions({
trayIconPath: path.join('assets/binanceIcon.png'),
windowUrl: `file://${path.join(__dirname, 'views/index.html')}`,
width: 340,
height: 380
})
}, timeout)
})
// ======
// let tray = null
// app.whenReady().then(() => {
// tray = new Tray('/assets/binanceIcon.png')
// const contextMenu = Menu.buildFromTemplate([
// { label: 'Item1', type: 'radio' },
// { label: 'Item2', type: 'radio' },
// { label: 'Item3', type: 'radio', checked: true },
// { label: 'Item4', type: 'radio' }
// ])
// tray.setToolTip('This is my application.')
// tray.setContextMenu(contextMenu)
// })