From 0b56259a368ec9bf8810f4be16bfcc12b28a6e89 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Fri, 10 Aug 2018 11:01:13 +0200 Subject: [PATCH] build fix --- app/index.pug | 2 +- app/main.js | 23 ++++++++++++++++------- app/src/preload.scss | 6 ++++++ package.json | 6 +++++- yarn.lock | 6 +++--- 5 files changed, 31 insertions(+), 12 deletions(-) diff --git a/app/index.pug b/app/index.pug index 45eb5085..8dc1e698 100644 --- a/app/index.pug +++ b/app/index.pug @@ -11,7 +11,7 @@ html style#custom-css style. body { transition: 0.5s background; } - body(style='min-height: 100vh; overflow: hidden') + body app-root .preload-logo div diff --git a/app/main.js b/app/main.js index 11481ce7..cf41752c 100644 --- a/app/main.js +++ b/app/main.js @@ -30,6 +30,15 @@ if (!process.env.TERMINUS_PLUGINS) { process.env.TERMINUS_PLUGINS = '' } +setWindowVibrancy = (enabled) => { + if (enabled && !app.window.vibrancyViewID) { + app.window.vibrancyViewID = electronVibrancy.SetVibrancy(app.window, 0) + } else if (!enabled && app.window.vibrancyViewID) { + electronVibrancy.RemoveView(app.window, app.window.vibrancyViewID) + app.window.vibrancyViewID = null + } +} + setupWindowManagement = () => { app.window.on('show', () => { app.window.webContents.send('host:window-shown') @@ -89,12 +98,7 @@ setupWindowManagement = () => { }) electron.ipcMain.on('window-set-vibrancy', (event, enabled) => { - if (enabled && !app.window.vibrancyViewID) { - app.window.vibrancyViewID = electronVibrancy.SetVibrancy(app.window, 0) - } else if (!enabled && app.window.vibrancyViewID) { - electronVibrancy.RemoveView(app.window, app.window.vibrancyViewID) - app.window.vibrancyViewID = null - } + setWindowVibrancy(enabled) }) } @@ -225,7 +229,7 @@ start = () => { title: 'Terminus', minWidth: 400, minHeight: 300, - 'web-preferences': {'web-security': false}, + webPreferences: {webSecurity: false}, //- background to avoid the flash of unstyled window backgroundColor: '#131d27', frame: false, @@ -250,6 +254,11 @@ start = () => { app.window = new electron.BrowserWindow(options) app.window.once('ready-to-show', () => { + if (process.platform == 'darwin') { + app.window.setVibrancy('dark') + } else if (process.platform == 'windows') { + setWindowVibrancy(true) + } app.window.show() app.window.focus() }) diff --git a/app/src/preload.scss b/app/src/preload.scss index c9b65145..06e413d5 100644 --- a/app/src/preload.scss +++ b/app/src/preload.scss @@ -66,3 +66,9 @@ [ngbradiogroup] input[type="radio"] { display: none; } + +body { + min-height: 100vh; + overflow: hidden; + background: rgba(0,0,0,.4); +} diff --git a/package.json b/package.json index 7f00beb4..74424201 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "core-js": "2.4.1", "cross-env": "4.0.0", "css-loader": "0.28.0", - "electron": "2.0.0", + "electron": "2.0.7", "electron-builder": "^20.27.1", "electron-builder-squirrel-windows": "17.0.1", "electron-rebuild": "^1.8.2", @@ -53,6 +53,10 @@ "appId": "org.terminus", "productName": "Terminus", "compression": "normal", + "files": [ + "**/*", + "dist" + ], "extraResources": [ "builtin-plugins", "clink" diff --git a/yarn.lock b/yarn.lock index 9a5b21f4..f9e7e230 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2615,9 +2615,9 @@ electron-to-chromium@^1.2.7: version "1.3.31" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.31.tgz#00d832cba9fe2358652b0c48a8816c8e3a037e9f" -electron@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/electron/-/electron-2.0.0.tgz#e95dc7f3a089a52b8c2a52c7c9e1024db0c8d46e" +electron@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/electron/-/electron-2.0.7.tgz#f7ce410433298e319032ce31f0e6ffd709ff052c" dependencies: "@types/node" "^8.0.24" electron-download "^3.0.1"