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

@@ -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)
}
}