From b881d486947f4f4e40ccb48490f30e8436ffe33f Mon Sep 17 00:00:00 2001 From: Denis Zhdanov Date: Thu, 31 Mar 2011 10:47:26 +0400 Subject: [PATCH] IDEA-67256 QuickDoc: Quick doc component has a too small size when its shown at the very first time Preferred size calculation was not configured for the JLayeredPane component recently added to the quick doc control --- .../codeInsight/documentation/DocumentationComponent.java | 7 +++++++ 1 file changed, 7 insertions(+) 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);