allow selecting windows vibrancy type (fixes #460)

This commit is contained in:
Eugene Pankov
2018-10-13 04:30:12 -07:00
parent 7b33d89032
commit 8f0f1b19df
8 changed files with 42 additions and 9 deletions

View File

@@ -224,7 +224,7 @@ export class AppRootComponent {
}
private updateVibrancy () {
this.hostApp.setVibrancy(this.config.store.appearance.vibrancy)
this.hostApp.setVibrancy(this.config.store.appearance.vibrancy, this.config.store.appearance.vibrancyType)
this.hostApp.getWindow().setOpacity(this.config.store.appearance.opacity)
}
}

View File

@@ -9,4 +9,5 @@ appearance:
css: '/* * { color: blue !important; } */'
opacity: 1.0
vibrancy: false
vibrancyType: 'blur'
enableAnalytics: true

View File

@@ -150,13 +150,13 @@ export class HostAppService {
this.electron.ipcRenderer.send('window-set-always-on-top', flag)
}
setVibrancy (enable: boolean) {
setVibrancy (enable: boolean, type: string) {
document.body.classList.toggle('vibrant', enable)
if (this.platform === Platform.macOS) {
this.getWindow().setVibrancy(enable ? 'dark' : null)
}
if (this.platform === Platform.Windows) {
this.electron.ipcRenderer.send('window-set-vibrancy', enable)
this.electron.ipcRenderer.send('window-set-vibrancy', enable, type)
}
}