新增全屏状态
This commit is contained in:
+1
-1
@@ -170,7 +170,7 @@ function createWindow() {
|
||||
// icon: path.join(global.__static, isWin ? 'icons/256x256.ico' : 'icons/512x512.png'),
|
||||
resizable: false,
|
||||
maximizable: false,
|
||||
fullscreenable: false,
|
||||
fullscreenable: true,
|
||||
show: false,
|
||||
webPreferences: {
|
||||
contextIsolation: false,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { app } = require('electron')
|
||||
const { mainOn, NAMES: { mainWindow: ipcMainWindowNames } } = require('../../common/ipc')
|
||||
const { mainOn, mainHandle, NAMES: { mainWindow: ipcMainWindowNames } } = require('../../common/ipc')
|
||||
|
||||
mainOn(ipcMainWindowNames.min, event => {
|
||||
if (global.modules.mainWindow) {
|
||||
@@ -16,3 +16,8 @@ mainOn(ipcMainWindowNames.close, (event, isForce) => {
|
||||
global.isTrafficLightClose = true
|
||||
if (global.modules.mainWindow) global.modules.mainWindow.close()
|
||||
})
|
||||
mainHandle(ipcMainWindowNames.fullscreen, async(event, isFullscreen) => {
|
||||
if (!global.modules.mainWindow) return false
|
||||
await global.modules.mainWindow.setFullScreen(isFullscreen)
|
||||
return isFullscreen
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user