Move inject into _handleOptionsChanged
This commit is contained in:
@@ -53,7 +53,7 @@ export class DomRenderer extends Disposable implements IRenderer {
|
|||||||
@IOptionsService private readonly _optionsService: IOptionsService,
|
@IOptionsService private readonly _optionsService: IOptionsService,
|
||||||
@IBufferService private readonly _bufferService: IBufferService,
|
@IBufferService private readonly _bufferService: IBufferService,
|
||||||
@ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,
|
@ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,
|
||||||
@IThemeService themeService: IThemeService
|
@IThemeService private readonly _themeService: IThemeService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this._rowContainer = document.createElement('div');
|
this._rowContainer = document.createElement('div');
|
||||||
@@ -67,13 +67,10 @@ export class DomRenderer extends Disposable implements IRenderer {
|
|||||||
|
|
||||||
this.dimensions = createRenderDimensions();
|
this.dimensions = createRenderDimensions();
|
||||||
this._updateDimensions();
|
this._updateDimensions();
|
||||||
this.register(this._optionsService.onOptionChange(() => {
|
this.register(this._optionsService.onOptionChange(() => this._handleOptionsChanged()));
|
||||||
this._handleOptionsChanged();
|
|
||||||
this._injectCss(themeService.colors);
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.register(themeService.onChangeColors(e => this._injectCss(e)));
|
this.register(this._themeService.onChangeColors(e => this._injectCss(e)));
|
||||||
this._injectCss(themeService.colors);
|
this._injectCss(this._themeService.colors);
|
||||||
|
|
||||||
this._rowFactory = instantiationService.createInstance(DomRendererRowFactory, document);
|
this._rowFactory = instantiationService.createInstance(DomRendererRowFactory, document);
|
||||||
|
|
||||||
@@ -343,6 +340,8 @@ export class DomRenderer extends Disposable implements IRenderer {
|
|||||||
private _handleOptionsChanged(): void {
|
private _handleOptionsChanged(): void {
|
||||||
// Force a refresh
|
// Force a refresh
|
||||||
this._updateDimensions();
|
this._updateDimensions();
|
||||||
|
// Refresh CSS
|
||||||
|
this._injectCss(this._themeService.colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
public clear(): void {
|
public clear(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user