diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index 8e079151..9c89b50f 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -91,14 +91,15 @@ export class BrowserWindow { minHeight: 390, frame: false, title: "Cider", - vibrancy: "fullscreen-ui", + vibrancy: "dark", transparent: process.platform === "darwin", - hasShadow: false, + hasShadow: true, show: false, - backgroundColor: "#1E1E1E", + // backgroundColor: "#1E1E1E", titleBarStyle: 'hidden', trafficLightPosition: {x: 15, y: 20}, webPreferences: { + experimentalFeatures: true, nodeIntegration: true, sandbox: true, allowRunningInsecureContent: true, @@ -129,8 +130,12 @@ export class BrowserWindow { switch(process.platform) { default: + break; + case "win32": + this.options.backgroundColor = "#1E1E1E"; break; case "linux": + this.options.backgroundColor = "#1E1E1E"; this.options.autoHideMenuBar = true this.options.frame = true break; diff --git a/src/main/base/plugins.ts b/src/main/base/plugins.ts index 3dc77b0f..ccb7f2e4 100644 --- a/src/main/base/plugins.ts +++ b/src/main/base/plugins.ts @@ -32,6 +32,7 @@ export class Plugins { if (fs.existsSync(this.userPluginsPath)) { fs.readdirSync(this.userPluginsPath).forEach(file => { + // Plugins V1 if (file.endsWith('.ts') || file.endsWith('.js')) { if (!electron.app.isPackaged) { 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 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); + } + } } }); } diff --git a/src/renderer/index.js b/src/renderer/index.js index c0b0442d..cc0f3c3b 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -452,7 +452,7 @@ const app = new Vue({ history.forward() }, getHTMLStyle() { - document.querySelector("html").style.background = "#222"; + // document.querySelector("html").style.background = "#222"; document.querySelector("body").classList.add("notransparency") }, resetState() { diff --git a/src/renderer/less/macos.less b/src/renderer/less/macos.less new file mode 100644 index 00000000..af21338b --- /dev/null +++ b/src/renderer/less/macos.less @@ -0,0 +1,17 @@ +body[platform="darwin"] { + html { + background: transparent!important; + } + + &.notransparency::before { + display: none; + } + #app { + &.simplebg { + background: transparent; + } + &::before { + display: none; + } + } +} \ No newline at end of file diff --git a/src/renderer/style.less b/src/renderer/style.less index 08813883..6ae9c835 100644 --- a/src/renderer/style.less +++ b/src/renderer/style.less @@ -3110,5 +3110,6 @@ body[platform='darwin'] { } +@import url("less/macos.less"); @import url("less/linux.less"); @import url("less/compact.less");