diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java index 5e98b4da87b6..65e35c2c2cdf 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java @@ -247,6 +247,13 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr } } } + + @Override + public Dimension getPreferredSize() { + Dimension editorPaneSize = myEditorPane.getPreferredScrollableViewportSize(); + Dimension controlPanelSize = myControlPanel.getPreferredSize(); + return new Dimension(Math.max(editorPaneSize.width, controlPanelSize.width), editorPaneSize.height + controlPanelSize.height); + } }; layeredPane.add(myScrollPane); layeredPane.setLayer(myScrollPane, 0);