Fixed: linux mini-window tranparent bug

This commit is contained in:
Molunerfinn 2018-07-11 09:39:23 +08:00
parent f48021d928
commit 353f553988
2 changed files with 21 additions and 5 deletions

View File

@ -204,7 +204,7 @@ const createMiniWidow = () => {
if (miniWindow) { if (miniWindow) {
return false return false
} }
miniWindow = new BrowserWindow({ let obj = {
height: 64, height: 64,
width: 64, width: 64,
show: false, show: false,
@ -216,7 +216,13 @@ const createMiniWidow = () => {
webPreferences: { webPreferences: {
backgroundThrottling: false backgroundThrottling: false
} }
}) }
if (process.platform === 'linux') {
obj.transparent = false
}
miniWindow = new BrowserWindow(obj)
miniWindow.loadURL(miniWinURL) miniWindow.loadURL(miniWinURL)

View File

@ -1,11 +1,12 @@
<template> <template>
<div id="mini-page" <div id="mini-page"
:style="{ 'backgroundImage': 'url(' + logo + ')' }" :style="{ backgroundImage: 'url(' + logo + ')' }"
:class="{ linux: os === 'linux' }"
> >
<!-- <i class="el-icon-upload2"></i> --> <!-- <i class="el-icon-upload2"></i> -->
<div <div
id="upload-area" id="upload-area"
:class="{ 'is-dragover': dragover, 'uploading': showProgress }" @drop.prevent="onDrop" @dragover.prevent="dragover = true" @dragleave.prevent="dragover = false" :class="{ 'is-dragover': dragover, uploading: showProgress, linux: os === 'linux' }" @drop.prevent="onDrop" @dragover.prevent="dragover = true" @dragleave.prevent="dragover = false"
:style="{ backgroundPosition: '0 ' + progress + '%'}" :style="{ backgroundPosition: '0 ' + progress + '%'}"
> >
<div id="upload-dragger" @dblclick="openUplodWindow"> <div id="upload-dragger" @dblclick="openUplodWindow">
@ -32,9 +33,13 @@ export default {
wY: '', wY: '',
screenX: '', screenX: '',
screenY: '', screenY: '',
menu: null menu: null,
os: ''
} }
}, },
created () {
this.os = process.platform
},
mounted () { mounted () {
this.$electron.ipcRenderer.on('uploadProgress', (event, progress) => { this.$electron.ipcRenderer.on('uploadProgress', (event, progress) => {
if (progress !== -1) { if (progress !== -1) {
@ -189,11 +194,16 @@ export default {
border 4px solid #fff border 4px solid #fff
box-sizing border-box box-sizing border-box
cursor pointer cursor pointer
&.linux
border-radius 0
background-size 100vh 100vw
#upload-area #upload-area
height 100% height 100%
width 100% width 100%
border-radius 50% border-radius 50%
transition all .2s ease-in-out transition all .2s ease-in-out
&.linux
border-radius 0
&.uploading &.uploading
background: linear-gradient(to top, #409EFF 50%, #fff 51%) background: linear-gradient(to top, #409EFF 50%, #fff 51%)
background-size 200% background-size 200%