mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-17 18:09:59 +00:00
fixed the color scheme preview not updating
This commit is contained in:
parent
72e667d59d
commit
c19e131d8c
@ -1,5 +1,5 @@
|
|||||||
import { Component, Input, ChangeDetectionStrategy } from '@angular/core'
|
import { Component, Input, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'
|
||||||
import { ConfigService, getCSSFontFamily } from 'terminus-core'
|
import { BaseComponent, ConfigService, getCSSFontFamily } from 'terminus-core'
|
||||||
import { TerminalColorScheme } from '../api/interfaces'
|
import { TerminalColorScheme } from '../api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@ -9,11 +9,19 @@ import { TerminalColorScheme } from '../api/interfaces'
|
|||||||
styles: [require('./colorSchemePreview.component.scss')],
|
styles: [require('./colorSchemePreview.component.scss')],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class ColorSchemePreviewComponent {
|
export class ColorSchemePreviewComponent extends BaseComponent {
|
||||||
@Input() scheme: TerminalColorScheme
|
@Input() scheme: TerminalColorScheme
|
||||||
@Input() fontPreview = false
|
@Input() fontPreview = false
|
||||||
|
|
||||||
constructor (public config: ConfigService) {}
|
constructor (
|
||||||
|
public config: ConfigService,
|
||||||
|
changeDetector: ChangeDetectorRef,
|
||||||
|
) {
|
||||||
|
super()
|
||||||
|
this.subscribeUntilDestroyed(config.changed$, () => {
|
||||||
|
changeDetector.markForCheck()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
getPreviewFontFamily (): string {
|
getPreviewFontFamily (): string {
|
||||||
return getCSSFontFamily(this.config.store)
|
return getCSSFontFamily(this.config.store)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user