Vibrancy (fixes #5) (#383)

This commit is contained in:
Eugene Pankov
2018-08-02 10:34:46 -07:00
committed by GitHub
parent 7e253d72ea
commit cc9c66c4a9
13 changed files with 120 additions and 59 deletions

View File

@@ -126,6 +126,9 @@ export class AppRootComponent {
})
this.touchbar.update()
config.changed$.subscribe(() => this.updateVibrancy())
this.updateVibrancy()
}
onGlobalHotkey () {
@@ -189,4 +192,10 @@ export class AppRootComponent {
.filter((button) => (button.weight > 0) === aboveZero)
.sort((a: IToolbarButton, b: IToolbarButton) => (a.weight || 0) - (b.weight || 0))
}
private updateVibrancy () {
document.body.classList.toggle('vibrant', this.config.store.appearance.vibrancy)
this.hostApp.getWindow().setVibrancy(this.config.store.appearance.vibrancy ? 'dark' : null)
this.hostApp.getWindow().setOpacity(this.config.store.appearance.opacity)
}
}