新增不强制win7开启透明效果即可使用
This commit is contained in:
+21
-10
@@ -1,5 +1,5 @@
|
||||
<template lang="pug">
|
||||
#container(v-if="isProd && !isLinux" :class="theme" @mouseenter="enableIgnoreMouseEvents" @mouseleave="dieableIgnoreMouseEvents")
|
||||
#container(v-if="isProd && !isNt" :class="theme" @mouseenter="enableIgnoreMouseEvents" @mouseleave="dieableIgnoreMouseEvents")
|
||||
core-aside#left
|
||||
#right
|
||||
core-toolbar#toolbar
|
||||
@@ -20,7 +20,7 @@
|
||||
<script>
|
||||
import dnscache from 'dnscache'
|
||||
import { mapMutations, mapGetters, mapActions } from 'vuex'
|
||||
import { rendererOn, rendererSend } from '../common/ipc'
|
||||
import { rendererOn, rendererSend, rendererInvoke } from '../common/ipc'
|
||||
import { isLinux } from '../common/utils'
|
||||
import music from './utils/music'
|
||||
import { throttle, openUrl } from './utils'
|
||||
@@ -35,12 +35,15 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
isProd: process.env.NODE_ENV === 'production',
|
||||
isLinux,
|
||||
isNt: false,
|
||||
globalObj: {
|
||||
apiSource: 'test',
|
||||
proxy: {},
|
||||
},
|
||||
updateTimeout: null,
|
||||
envParams: {
|
||||
nt: false,
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -66,7 +69,7 @@ export default {
|
||||
}, 1000)
|
||||
},
|
||||
mounted() {
|
||||
document.body.classList.add(this.isLinux ? 'noTransparent' : 'transparent')
|
||||
document.body.classList.add(this.isNt ? 'noTransparent' : 'transparent')
|
||||
this.init()
|
||||
},
|
||||
watch: {
|
||||
@@ -109,11 +112,19 @@ export default {
|
||||
...mapMutations('download', ['updateDownloadList']),
|
||||
...mapMutations(['setSetting']),
|
||||
init() {
|
||||
rendererInvoke('getEnvParams').then(envParams => {
|
||||
this.envParams = envParams
|
||||
this.isNt = isLinux || this.envParams.nt
|
||||
if (this.isNt) {
|
||||
document.body.classList.remove('transparent')
|
||||
document.body.classList.add('noTransparent')
|
||||
}
|
||||
if (this.isProd && !this.isNt) {
|
||||
document.body.addEventListener('mouseenter', this.dieableIgnoreMouseEvents)
|
||||
document.body.addEventListener('mouseleave', this.enableIgnoreMouseEvents)
|
||||
}
|
||||
})
|
||||
document.body.addEventListener('click', this.handleBodyClick, true)
|
||||
if (this.isProd && !isLinux) {
|
||||
document.body.addEventListener('mouseenter', this.dieableIgnoreMouseEvents)
|
||||
document.body.addEventListener('mouseleave', this.enableIgnoreMouseEvents)
|
||||
}
|
||||
rendererOn('update-available', (e, info) => {
|
||||
// this.showUpdateModal(true)
|
||||
// console.log(info)
|
||||
@@ -173,12 +184,12 @@ export default {
|
||||
music.init()
|
||||
},
|
||||
enableIgnoreMouseEvents() {
|
||||
if (isLinux) return
|
||||
if (!this.isNt) return
|
||||
rendererSend('setIgnoreMouseEvents', false)
|
||||
// console.log('content enable')
|
||||
},
|
||||
dieableIgnoreMouseEvents() {
|
||||
if (isLinux) return
|
||||
if (!this.isNt) return
|
||||
// console.log('content disable')
|
||||
rendererSend('setIgnoreMouseEvents', true)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user