This commit is contained in:
Eugene Pankov
2017-04-20 22:00:21 +02:00
parent e6310a17f8
commit d909c4a791
3 changed files with 9 additions and 7 deletions

View File

@@ -13,3 +13,4 @@ export { ElectronService } from '../services/electron.service'
export { Logger, LogService } from '../services/log.service'
export { HotkeysService } from '../services/hotkeys.service'
export { HostAppService, Platform } from '../services/hostApp.service'
export { ThemesService } from '../services/themes.service'

View File

@@ -21,6 +21,10 @@ export class ThemesService {
return this.themes.find(x => x.name === name)
}
findCurrentTheme (): Theme {
return this.findTheme(this.config.store.appearance.theme) || this.findTheme('Standard')
}
applyTheme (theme: Theme): void {
if (!this.styleElement) {
this.styleElement = document.createElement('style')
@@ -31,10 +35,6 @@ export class ThemesService {
}
applyCurrentTheme (): void {
let theme = this.findTheme(this.config.store.appearance.theme)
if (!theme) {
theme = this.findTheme('Standard')
}
this.applyTheme(theme)
this.applyTheme(this.findCurrentTheme())
}
}