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
This commit is contained in:
Denis Zhdanov
2011-03-31 10:48:53 +04:00
parent 455882f6a0
commit b881d48694
@@ -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);