onThemeChange -> setColors
This commit is contained in:
+1
-1
@@ -851,7 +851,7 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
|
||||
this._theme = theme;
|
||||
this._colorManager.setTheme(theme);
|
||||
if (this.renderer) {
|
||||
this.renderer.onThemeChange(this._colorManager.colors);
|
||||
this.renderer.setColors(this._colorManager.colors);
|
||||
}
|
||||
if (this.viewport) {
|
||||
this.viewport.onThemeChange(this._colorManager.colors);
|
||||
|
||||
@@ -384,7 +384,7 @@ export class MockRenderer implements IRenderer {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
dimensions: IRenderDimensions;
|
||||
onThemeChange(colors: IColorSet): void {
|
||||
setColors(colors: IColorSet): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
onResize(cols: number, rows: number): void {}
|
||||
|
||||
@@ -74,7 +74,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
|
||||
public onGridChanged(terminal: ITerminal, startRow: number, endRow: number): void {}
|
||||
public onSelectionChanged(terminal: ITerminal, start: [number, number], end: [number, number], columnSelectMode: boolean = false): void {}
|
||||
|
||||
public onThemeChange(terminal: ITerminal, colorSet: IColorSet): void {
|
||||
public setColors(terminal: ITerminal, colorSet: IColorSet): void {
|
||||
this._refreshCharAtlas(terminal, colorSet);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,10 +85,12 @@ export class Renderer extends Disposable implements IRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
public onThemeChange(colors: IColorSet): void {
|
||||
public setColors(colors: IColorSet): void {
|
||||
this._colors = colors;
|
||||
|
||||
// Clear layers and force a full render
|
||||
this._renderLayers.forEach(l => {
|
||||
l.onThemeChange(this._terminal, this._colors);
|
||||
l.setColors(this._terminal, this._colors);
|
||||
l.reset(this._terminal);
|
||||
});
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export interface IRenderer extends IDisposable {
|
||||
dimensions: IRenderDimensions;
|
||||
|
||||
dispose(): void;
|
||||
onThemeChange(colors: IColorSet): void;
|
||||
setColors(colors: IColorSet): void;
|
||||
onDevicePixelRatioChange(): void;
|
||||
onResize(cols: number, rows: number): void;
|
||||
onCharSizeChanged(): void;
|
||||
@@ -82,7 +82,7 @@ export interface IRenderLayer extends IDisposable {
|
||||
/**
|
||||
* Called when the theme changes.
|
||||
*/
|
||||
onThemeChange(terminal: ITerminal, colorSet: IColorSet): void;
|
||||
setColors(terminal: ITerminal, colorSet: IColorSet): void;
|
||||
|
||||
/**
|
||||
* Called when the data in the grid has changed (or needs to be rendered
|
||||
|
||||
@@ -131,7 +131,7 @@ export class DomRenderer extends Disposable implements IRenderer {
|
||||
this._terminal.screenElement.style.height = `${this.dimensions.canvasHeight}px`;
|
||||
}
|
||||
|
||||
public onThemeChange(colors: IColorSet): void {
|
||||
public setColors(colors: IColorSet): void {
|
||||
this._colors = colors;
|
||||
this._injectCss();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user