diff --git a/src/browser/renderer/DecorationRenderLayer.ts b/src/browser/renderer/DecorationRenderLayer.ts index fd01c275..621b616e 100644 --- a/src/browser/renderer/DecorationRenderLayer.ts +++ b/src/browser/renderer/DecorationRenderLayer.ts @@ -69,23 +69,22 @@ class BufferDecoration extends Disposable implements IDecoration { private readonly _container: HTMLElement ) { super(); - this._marker = decorationOptions.marker; const color = DefaultButton.COLOR; - this._element = document.createElement('menu'); + this._element = document.createElement('div'); this._element.classList.add('button-buffer-decoration'); this._element.id = 'button-buffer-decoration-' + this._id; this._element.style.background = color; - this._element.style.width = '1px'; - this._element.style.height = '32px'; + this._element.style.width = '24px'; + this._element.style.height = '24px'; this._element.style.borderRadius = '64px'; this._element.style.border = `4px solid white`; this._element.style.zIndex = '6'; this._element.style.position = 'absolute'; if (decorationOptions.anchor === 'right') { - this._element.style.right = '5px'; + this._element.style.right = `${decorationOptions.x}px` || '5px'; } else { - this._element.style.left = '5px'; + this._element.style.right = `${decorationOptions.x}px` || '5px'; } if (this._container.parentElement && this._element) { this._container.parentElement.append(this._element); diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 22eba5d1..a6ff47ad 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -424,14 +424,14 @@ declare module 'xterm' { * is rendered, returns the dom element * associated with the decoration. */ - onRender: IEvent; + readonly onRender: IEvent; /** * The HTMLElement that gets created after the * first _onRender call, or undefined if accessed before * that. */ - element: HTMLElement | undefined; + readonly element: HTMLElement | undefined; } export interface IBufferDecorationOptions { @@ -447,18 +447,6 @@ declare module 'xterm' { */ anchor?: 'right' | 'left'; - /** - * The width of the decoration, which defaults to - * cell width - */ - width?: number; - - /** - * The height of the decoration, which defaults to - * cell height - */ - height?: number; - /** * The x position offset relative to the anchor */ @@ -946,7 +934,8 @@ declare module 'xterm' { /** * (EXPERIMENTAL) Adds a decoration to the terminal using * @param decorationOptions, which takes a marker and an optional anchor, - * width, height, and x offset from the anchor + * width, height, and x offset from the anchor. Returns the decoration or + * undefined if the marker has already been disposed of. */ registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined;