Skip to content

Commit

Permalink
Merge pull request #4475 from kelvinhammond/patch-1
Browse files Browse the repository at this point in the history
Re-render browser DOM style onOptionsChanged, fixes #4474
  • Loading branch information
Tyriar committed May 9, 2023
2 parents 913cb25 + 854e273 commit 075f330
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/browser/renderer/dom/DomRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class DomRenderer extends Disposable implements IRenderer {
@IOptionsService private readonly _optionsService: IOptionsService,
@IBufferService private readonly _bufferService: IBufferService,
@ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,
@IThemeService themeService: IThemeService
@IThemeService private readonly _themeService: IThemeService
) {
super();
this._rowContainer = document.createElement('div');
Expand All @@ -69,8 +69,8 @@ export class DomRenderer extends Disposable implements IRenderer {
this._updateDimensions();
this.register(this._optionsService.onOptionChange(() => this._handleOptionsChanged()));

this.register(themeService.onChangeColors(e => this._injectCss(e)));
this._injectCss(themeService.colors);
this.register(this._themeService.onChangeColors(e => this._injectCss(e)));
this._injectCss(this._themeService.colors);

this._rowFactory = instantiationService.createInstance(DomRendererRowFactory, document);

Expand Down Expand Up @@ -340,6 +340,8 @@ export class DomRenderer extends Disposable implements IRenderer {
private _handleOptionsChanged(): void {
// Force a refresh
this._updateDimensions();
// Refresh CSS
this._injectCss(this._themeService.colors);
}

public clear(): void {
Expand Down

0 comments on commit 075f330

Please sign in to comment.