分离方法
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
const { mainOn, NAMES: { mainWindow: ipcMainWindowNames } } = require('../../common/ipc')
|
||||
const { openDevTools } = require('@main/utils')
|
||||
|
||||
mainOn(ipcMainWindowNames.open_dev_tools, event => {
|
||||
if (global.modules.mainWindow) {
|
||||
if (global.modules.mainWindow.isDevToolsOpened()) {
|
||||
global.modules.mainWindow.webContents.closeDevTools()
|
||||
} else {
|
||||
global.modules.mainWindow.webContents.openDevTools({
|
||||
mode: 'undocked',
|
||||
})
|
||||
openDevTools(global.modules.mainWindow.webContents)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const { isWin } = require('../../common/utils')
|
||||
const { openDevTools } = require('@main/utils')
|
||||
const { mainSend, NAMES: { mainWindow: ipcMainWindowNames } } = require('../../common/ipc')
|
||||
global.isQuitting = false
|
||||
global.isTrafficLightClose = false // 是否点击软件上的关闭按钮关闭
|
||||
@@ -30,7 +31,7 @@ module.exports = mainWindow => {
|
||||
mainWindow.once('ready-to-show', () => {
|
||||
mainWindow.show()
|
||||
global.lx_event.mainWindow.readyToShow()
|
||||
if (global.envParams.cmdParams.debug) global.modules.mainWindow.webContents.openDevTools()
|
||||
if (global.envParams.cmdParams.debug) openDevTools(global.modules.mainWindow.webContents)
|
||||
})
|
||||
|
||||
mainWindow.on('show', () => {
|
||||
|
||||
Reference in New Issue
Block a user