Fixed acrylic

when out of focus, fills with #592027 (emphasizes color of cider)
This commit is contained in:
yazninja 2022-01-10 23:34:23 +08:00 committed by GitHub
parent ff64894a37
commit 65b1073ae8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ const CiderBase = {
frame: false, frame: false,
title: "Cider", title: "Cider",
vibrancy: 'dark', vibrancy: 'dark',
// transparent: true, //transparent: true,
hasShadow: false, hasShadow: false,
webPreferences: { webPreferences: {
webviewTag: true, webviewTag: true,
@ -71,14 +71,10 @@ const CiderBase = {
if (process.platform === "darwin" || process.platform === "linux") { if (process.platform === "darwin" || process.platform === "linux") {
win = new BrowserWindow(options) win = new BrowserWindow(options)
} else { } else {
// i don't know why but we have to do this for acrylic to work properly
if (app.cfg.get("visual.window_transparency") !== "disabled") { if (app.cfg.get("visual.window_transparency") !== "disabled") {
const { BrowserWindow } = require("electron-acrylic-window"); const { BrowserWindow } = require("electron-acrylic-window");
win = new BrowserWindow(options) win = new BrowserWindow(options)
win.setVibrancy("dark") win.setVibrancy("#59202700") // when out of focus, fills with #592027, 00 is aplha values
} else {
win = new BrowserWindow(options)
win.setVibrancy("dark")
} }
} }