修复对dt参数的读取

pull/392/head
lyswhut 2021-01-09 20:13:32 +08:00
parent 1e904e5ebb
commit 8b0779ac17
2 changed files with 12 additions and 11 deletions

View File

@ -28,6 +28,7 @@ require('./env')
// Is disable hardware acceleration
if (global.envParams.cmdParams.dha) app.disableHardwareAcceleration()
if (global.envParams.cmdParams.dt == null && global.envParams.cmdParams.nt != null) global.envParams.cmdParams.dt = global.envParams.cmdParams.nt
// https://github.com/electron/electron/issues/22691
app.commandLine.appendSwitch('wm-window-animations-disabled')
@ -100,7 +101,7 @@ function createWindow() {
useContentSize: true,
width: windowSizeInfo.width,
frame: false,
transparent: !global.envParams.cmdParams.nt,
transparent: !global.envParams.cmdParams.dt,
enableRemoteModule: false,
// icon: path.join(global.__static, isWin ? 'icons/256x256.ico' : 'icons/512x512.png'),
resizable: false,

View File

@ -1,5 +1,5 @@
<template lang="pug">
#container(v-if="isProd && !isNt && !isLinux" :class="theme" @mouseenter="enableIgnoreMouseEvents" @mouseleave="dieableIgnoreMouseEvents")
#container(v-if="isProd && !isDT && !isLinux" :class="theme" @mouseenter="enableIgnoreMouseEvents" @mouseleave="dieableIgnoreMouseEvents")
core-aside#left
#right
core-toolbar#toolbar
@ -41,7 +41,7 @@ export default {
data() {
return {
isProd: process.env.NODE_ENV === 'production',
isNt: false,
isDT: false,
isLinux,
globalObj: {
apiSource: 'test',
@ -102,7 +102,7 @@ export default {
}, 500)
},
mounted() {
document.body.classList.add(this.isNt ? 'noTransparent' : 'transparent')
document.body.classList.add(this.isDT ? 'disableTransparent' : 'transparent')
window.eventHub.$emit(eventBaseName.bindKey)
this.init()
},
@ -254,12 +254,12 @@ export default {
music.init()
},
enableIgnoreMouseEvents() {
if (this.isNt) return
if (this.isDT) return
rendererSend(NAMES.mainWindow.set_ignore_mouse_events, false)
// console.log('content enable')
},
dieableIgnoreMouseEvents() {
if (this.isNt) return
if (this.isDT) return
// console.log('content disable')
rendererSend(NAMES.mainWindow.set_ignore_mouse_events, true)
},
@ -380,12 +380,12 @@ export default {
},
handleEnvParamsInit(envParams) {
this.envParams = envParams
this.isNt = this.envParams.nt
if (this.isNt) {
this.isDT = this.envParams.dt
if (this.isDT) {
document.body.classList.remove('transparent')
document.body.classList.add('noTransparent')
document.body.classList.add('disableTransparent')
}
if (this.isProd && !this.isNt && !this.isLinux) {
if (this.isProd && !this.isDT && !this.isLinux) {
document.body.addEventListener('mouseenter', this.dieableIgnoreMouseEvents)
document.body.addEventListener('mouseleave', this.enableIgnoreMouseEvents)
}
@ -455,7 +455,7 @@ body {
background-color: transparent;
}
}
.noTransparent {
.disableTransparent {
background-color: #fff;
#right {