mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-29 17:41:32 +01:00
setting some minimum dimensions on the content hover.
This commit is contained in:
@@ -504,6 +504,7 @@ export class ContentHoverWidget extends ResizableContentWidget {
|
||||
this._hoverFocusedKey.set(false);
|
||||
}));
|
||||
this._setHoverData(undefined);
|
||||
this._setMinimumDimensions();
|
||||
this._layout();
|
||||
this._editor.addContentWidget(this);
|
||||
}
|
||||
@@ -518,6 +519,15 @@ export class ContentHoverWidget extends ResizableContentWidget {
|
||||
return ContentHoverWidget.ID;
|
||||
}
|
||||
|
||||
private _setMinimumDimensions(): void {
|
||||
const width = 50;
|
||||
const height = this._editor.getOption(EditorOption.lineHeight) + 8;
|
||||
const contentsDomNode = this._hover.contentsDomNode;
|
||||
contentsDomNode.style.minWidth = width + 'px';
|
||||
contentsDomNode.style.minHeight = height + 'px';
|
||||
this._resizableNode.minSize = new dom.Dimension(width, height);
|
||||
}
|
||||
|
||||
private static _applyDimensions(container: HTMLElement, width: number | string, height: number | string): void {
|
||||
const transformedWidth = typeof width === 'number' ? `${width}px` : width;
|
||||
const transformedHeight = typeof height === 'number' ? `${height}px` : height;
|
||||
|
||||
Reference in New Issue
Block a user