Merge branch 'develop' of https://github.com/Apple-Music-Electron/Cider into develop

This commit is contained in:
cryptofyre 2022-02-18 01:00:35 -06:00
commit 698bcbc30c
5 changed files with 46 additions and 5 deletions

View file

@ -91,14 +91,15 @@ 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: {
experimentalFeatures: true,
nodeIntegration: true, nodeIntegration: true,
sandbox: true, sandbox: true,
allowRunningInsecureContent: true, allowRunningInsecureContent: true,
@ -129,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;

View file

@ -32,6 +32,7 @@ export class Plugins {
if (fs.existsSync(this.userPluginsPath)) { if (fs.existsSync(this.userPluginsPath)) {
fs.readdirSync(this.userPluginsPath).forEach(file => { fs.readdirSync(this.userPluginsPath).forEach(file => {
// Plugins V1
if (file.endsWith('.ts') || file.endsWith('.js')) { if (file.endsWith('.ts') || file.endsWith('.js')) {
if (!electron.app.isPackaged) { if (!electron.app.isPackaged) {
const plugin = require(path.join(this.userPluginsPath, file)).default; const plugin = require(path.join(this.userPluginsPath, file)).default;
@ -50,7 +51,24 @@ export class Plugins {
plugins[file] = new plugin(electron.app, utils.getStore()); plugins[file] = new plugin(electron.app, utils.getStore());
} }
} }
}
// Plugins V2
else if (fs.lstatSync(path.join(this.userPluginsPath, file)).isDirectory()) {
const pluginPath = path.join(this.userPluginsPath, file);
if (fs.existsSync(path.join(pluginPath, 'package.json'))) {
const plugin = require(path.join(pluginPath, "index.js"));
if (plugins[plugin.name] || plugin.name in plugins) {
console.log(`[${plugin.name}] Plugin already loaded / Duplicate Class Name`);
} else {
const pluginEnv = {
app: electron.app,
store: utils.getStore(),
utils: utils,
dir: pluginPath
}
plugins[plugin.name] = new plugin(pluginEnv);
}
}
} }
}); });
} }

View file

@ -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() {

View file

@ -0,0 +1,17 @@
body[platform="darwin"] {
html {
background: transparent!important;
}
&.notransparency::before {
display: none;
}
#app {
&.simplebg {
background: transparent;
}
&::before {
display: none;
}
}
}

View file

@ -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");