|
|
@@ -8,7 +8,6 @@ class MainSerivce {
|
|
|
app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required');
|
|
|
this.loadingWin = null
|
|
|
this.mainWin = null
|
|
|
- this.icon = join(__dirname, './icon/playGame.png')
|
|
|
this.contrlEvent = null
|
|
|
if (!app.requestSingleInstanceLock({ key: 'contrl' })) {
|
|
|
app.quit()
|
|
|
@@ -32,7 +31,6 @@ class MainSerivce {
|
|
|
height,
|
|
|
resizable: false,
|
|
|
center: true,
|
|
|
- icon: this.icon,
|
|
|
alwaysOnTop: true,
|
|
|
transparent: true // 窗口是否支持透明,如果想做高级效果最好为true
|
|
|
})
|
|
|
@@ -54,7 +52,6 @@ class MainSerivce {
|
|
|
height: 760,
|
|
|
frame: false,
|
|
|
transparent: true,
|
|
|
- icon: this.icon,
|
|
|
webPreferences: {
|
|
|
contextIsolation: true,
|
|
|
nodeIntegration: true,
|
|
|
@@ -80,20 +77,6 @@ class MainSerivce {
|
|
|
this.createLoading()
|
|
|
this.createWindow()
|
|
|
|
|
|
- // 图标
|
|
|
- const tray = new Tray(this.icon)
|
|
|
- const contextMenu = Menu.buildFromTemplate([
|
|
|
- {
|
|
|
- label: '退出',
|
|
|
- click: () => {
|
|
|
- this.mainWin.close()
|
|
|
- app.quit()
|
|
|
- }
|
|
|
- }
|
|
|
- ])
|
|
|
- tray.setToolTip('demo')
|
|
|
- tray.on('click', () => this.mainWin.show())
|
|
|
-
|
|
|
// 注册调试模式
|
|
|
globalShortcut.register('Ctrl+F12', () => {
|
|
|
this.mainWin.webContents.toggleDevTools()
|
|
|
@@ -111,8 +94,6 @@ class MainSerivce {
|
|
|
}, 100) //延时太快会立刻启动,太慢会妨碍窗口其他操作,可自行测试最佳时间
|
|
|
return true
|
|
|
})
|
|
|
- } else if (platform === 'darwin') {
|
|
|
- app.dock.setIcon(join(__dirname, 'electron/icon/playGame@2x.png'))
|
|
|
}
|
|
|
|
|
|
// 通信
|