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

View File

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