提交 970253ae 编写于 作者: J Joao Moreno

dynamic hover height

上级 71076263
......@@ -28,7 +28,6 @@
.monaco-editor-hover .monaco-editor-hover-content {
max-width: 438px;
max-height: 244px;
}
.monaco-editor-hover .hover-row {
......
......@@ -67,6 +67,9 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent
}
}));
this._editor.onDidLayoutChange(e => this.updateMaxHeight());
this.updateMaxHeight();
this._editor.addContentWidget(this);
this._showAtPosition = null;
}
......@@ -141,6 +144,12 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent
this._editor.layoutContentWidget(this);
this.scrollbar.scanDomNode();
}
private updateMaxHeight(): void {
const height = Math.max(this._editor.getLayoutInfo().height / 4, 250);
this._domNode.style.maxHeight = `${ height }px`;
}
}
export class GlyphHoverWidget extends Widget implements editorBrowser.IOverlayWidget {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册