hide empty toolbars
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Tue, 10 Jan 2012 11:13:16 +0000 (15:13 +0400)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Tue, 10 Jan 2012 11:51:25 +0000 (15:51 +0400)
platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionToolbarImpl.java

index 4c1c92dd8cc7b1a89ee79eb0be196cfa3feb9a82..bb1f727859fbf2f80df8d5ea57e97f1b71c3d28b 100644 (file)
@@ -643,7 +643,7 @@ public class ActionToolbarImpl extends JPanel implements ActionToolbar {
   public Dimension getPreferredSize() {
     final ArrayList<Rectangle> bounds = new ArrayList<Rectangle>();
     calculateBounds(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE), bounds);
-
+    if (bounds.isEmpty()) return new Dimension(0, 0);
     int xLeft = Integer.MAX_VALUE;
     int yTop = Integer.MAX_VALUE;
     int xRight = Integer.MIN_VALUE;