Skip to content

Commit bc44929

Browse files
committed
changing initial size to minimum size
1 parent 01851f6 commit bc44929

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/vs/editor/contrib/hover/browser/contentHover.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ export class ContentHoverController extends Disposable {
5252
) {
5353
super();
5454

55-
const initialHeight = this._editor.getOption(EditorOption.lineHeight) + 8;
56-
const initialWidth = 4 / 3 * initialHeight;
57-
const initialSize = new dom.Dimension(initialWidth, initialHeight);
58-
this._widget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor, initialSize));
55+
const minimumHeight = this._editor.getOption(EditorOption.lineHeight) + 8;
56+
const minimumWidth = 4 / 3 * minimumHeight;
57+
const minimumSize = new dom.Dimension(minimumWidth, minimumHeight);
58+
this._widget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor, minimumSize));
5959

6060
// Instantiate participants and sort them by `hoverOrdinal` which is relevant for rendering order.
6161
this._participants = [];
@@ -486,10 +486,10 @@ export class ContentHoverWidget extends ResizableContentWidget {
486486

487487
constructor(
488488
editor: ICodeEditor,
489-
initialSize: dom.Dimension,
489+
minimumSize: dom.Dimension,
490490
@IContextKeyService contextKeyService: IContextKeyService
491491
) {
492-
super(editor, initialSize);
492+
super(editor, minimumSize);
493493
this._hoverVisibleKey = EditorContextKeys.hoverVisible.bindTo(contextKeyService);
494494
this._hoverFocusedKey = EditorContextKeys.hoverFocused.bindTo(contextKeyService);
495495

src/vs/editor/contrib/hover/browser/resizableContentWidget.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ export abstract class ResizableContentWidget extends Disposable implements ICont
2525

2626
constructor(
2727
protected readonly _editor: ICodeEditor,
28-
initialSize: dom.IDimension = new dom.Dimension(10, 10)
28+
minimumSize: dom.IDimension = new dom.Dimension(10, 10)
2929
) {
3030
super();
3131
this._resizableNode.domNode.style.position = 'absolute';
32-
this._resizableNode.minSize = new dom.Dimension(10, 10);
32+
this._resizableNode.minSize = dom.Dimension.lift(minimumSize);
33+
this._resizableNode.layout(minimumSize.height, minimumSize.width);
3334
this._resizableNode.enableSashes(true, true, true, true);
34-
this._resizableNode.layout(initialSize.height, initialSize.width);
3535
this._register(this._resizableNode.onDidResize(e => {
3636
this._resize(new dom.Dimension(e.dimension.width, e.dimension.height));
3737
if (e.done) {

0 commit comments

Comments
 (0)