allow changing the color of overview decorations
This commit is contained in:
@@ -92,7 +92,7 @@ export class OverviewRulerRenderer extends Disposable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._ctx.lineWidth = 1;
|
this._ctx.lineWidth = 1;
|
||||||
this._ctx.fillStyle = decoration.options.overviewRulerOptions.color;
|
this._ctx.fillStyle = decoration.overviewRulerDecorationColor || decoration.options.overviewRulerOptions.color;
|
||||||
this._ctx.fillRect(
|
this._ctx.fillRect(
|
||||||
!decoration.options.overviewRulerOptions.position || decoration.options.overviewRulerOptions.position === 'left' ? 0 : decoration.options.overviewRulerOptions.position === 'right' ? renderSizes[SizeIndex.OUTER_SIZE] + renderSizes[SizeIndex.INNER_SIZE]: renderSizes[SizeIndex.OUTER_SIZE],
|
!decoration.options.overviewRulerOptions.position || decoration.options.overviewRulerOptions.position === 'left' ? 0 : decoration.options.overviewRulerOptions.position === 'right' ? renderSizes[SizeIndex.OUTER_SIZE] + renderSizes[SizeIndex.INNER_SIZE]: renderSizes[SizeIndex.OUTER_SIZE],
|
||||||
Math.round(this._canvas.height * (decoration.options.marker.line / this._bufferService.buffers.active.lines.length)),
|
Math.round(this._canvas.height * (decoration.options.marker.line / this._bufferService.buffers.active.lines.length)),
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class Decoration extends Disposable implements IInternalDecoration {
|
|||||||
private _onDispose = this.register(new EventEmitter<void>());
|
private _onDispose = this.register(new EventEmitter<void>());
|
||||||
public readonly onDispose = this._onDispose.event;
|
public readonly onDispose = this._onDispose.event;
|
||||||
|
|
||||||
|
public overviewRulerDecorationColor: string | undefined;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public readonly options: IDecorationOptions
|
public readonly options: IDecorationOptions
|
||||||
) {
|
) {
|
||||||
|
|||||||
Vendored
+5
@@ -438,6 +438,11 @@ declare module 'xterm' {
|
|||||||
* that.
|
* that.
|
||||||
*/
|
*/
|
||||||
element: HTMLElement | undefined;
|
element: HTMLElement | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The color for the decoration.
|
||||||
|
*/
|
||||||
|
overviewRulerDecorationColor: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user