macOS transparency
This commit is contained in:
parent
dd879b46c5
commit
231936c0c7
4 changed files with 26 additions and 4 deletions
|
@ -91,11 +91,11 @@ export class BrowserWindow {
|
||||||
minHeight: 390,
|
minHeight: 390,
|
||||||
frame: false,
|
frame: false,
|
||||||
title: "Cider",
|
title: "Cider",
|
||||||
vibrancy: "fullscreen-ui",
|
vibrancy: "dark",
|
||||||
transparent: process.platform === "darwin",
|
transparent: process.platform === "darwin",
|
||||||
hasShadow: false,
|
hasShadow: true,
|
||||||
show: false,
|
show: false,
|
||||||
//backgroundColor: "#1E1E1E",
|
// backgroundColor: "#1E1E1E",
|
||||||
titleBarStyle: 'hidden',
|
titleBarStyle: 'hidden',
|
||||||
trafficLightPosition: {x: 15, y: 20},
|
trafficLightPosition: {x: 15, y: 20},
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
@ -130,8 +130,12 @@ export class BrowserWindow {
|
||||||
switch(process.platform) {
|
switch(process.platform) {
|
||||||
default:
|
default:
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "win32":
|
||||||
|
this.options.backgroundColor = "#1E1E1E";
|
||||||
break;
|
break;
|
||||||
case "linux":
|
case "linux":
|
||||||
|
this.options.backgroundColor = "#1E1E1E";
|
||||||
this.options.autoHideMenuBar = true
|
this.options.autoHideMenuBar = true
|
||||||
this.options.frame = true
|
this.options.frame = true
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -452,7 +452,7 @@ const app = new Vue({
|
||||||
history.forward()
|
history.forward()
|
||||||
},
|
},
|
||||||
getHTMLStyle() {
|
getHTMLStyle() {
|
||||||
document.querySelector("html").style.background = "#222";
|
// document.querySelector("html").style.background = "#222";
|
||||||
document.querySelector("body").classList.add("notransparency")
|
document.querySelector("body").classList.add("notransparency")
|
||||||
},
|
},
|
||||||
resetState() {
|
resetState() {
|
||||||
|
|
17
src/renderer/less/macos.less
Normal file
17
src/renderer/less/macos.less
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
body[platform="darwin"] {
|
||||||
|
html {
|
||||||
|
background: transparent!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.notransparency::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#app {
|
||||||
|
&.simplebg {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
&::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3110,5 +3110,6 @@ body[platform='darwin'] {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@import url("less/macos.less");
|
||||||
@import url("less/linux.less");
|
@import url("less/linux.less");
|
||||||
@import url("less/compact.less");
|
@import url("less/compact.less");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue