Browse Source

Added acrylic background for linux

Gwilherm Folliot 5 years ago
parent
commit
9190893ccf
3 changed files with 12 additions and 5 deletions
  1. 9 3
      app/lib/window.ts
  2. 1 0
      package.json
  3. 2 2
      terminus-settings/src/components/settingsTab.component.pug

+ 9 - 3
app/lib/window.ts

@@ -1,3 +1,5 @@
+import * as glasstron from 'glasstron'
+glasstron.init()
 import { Subject, Observable } from 'rxjs'
 import { debounceTime } from 'rxjs/operators'
 import { BrowserWindow, app, ipcMain, Rectangle, Menu, screen } from 'electron'
@@ -82,11 +84,13 @@ export class Window {
             }
         }
 
+        this.window = new BrowserWindow(bwOptions)
+
         if (process.platform === 'linux') {
-            bwOptions.backgroundColor = '#131d27'
+            glasstron.update(this.window, {
+                linux: {requestBlur: true}
+            });
         }
-
-        this.window = new BrowserWindow(bwOptions)
         this.window.once('ready-to-show', () => {
             if (process.platform === 'darwin') {
                 this.window.setVibrancy('window')
@@ -146,6 +150,8 @@ export class Window {
             } else {
                 DwmEnableBlurBehindWindow(this.window, enabled)
             }
+        }else if(process.platform ==="linux"){
+            this.window.setBackgroundColor(enabled ? "#00000000" : "#131d27")
         } else {
             this.window.setVibrancy(enabled ? 'dark' : null as any) // electron issue 20269
         }

+ 1 - 0
package.json

@@ -25,6 +25,7 @@
     "eslint-plugin-import": "^2.20.2",
     "file-loader": "^5.0.2",
     "graceful-fs": "^4.2.4",
+    "glasstron": "0.0.3",
     "html-loader": "0.5.5",
     "json-loader": "0.5.7",
     "node-abi": "^2.16.0",

+ 2 - 2
terminus-settings/src/components/settingsTab.component.pug

@@ -52,9 +52,9 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab')
                         )
                         | At the bottom
 
-            .form-line(*ngIf='hostApp.platform !== Platform.Linux')
+            .form-line
                 .header
-                    .title(*ngIf='hostApp.platform === Platform.Windows') Acrylic background
+                    .title(*ngIf='hostApp.platform !== Platform.macOS') Acrylic background
                     .title(*ngIf='hostApp.platform === Platform.macOS') Vibrancy
                     .description Gives the window a blurred transparent background