Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java	(revision 14765)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java	(revision 14766)
@@ -38,5 +38,5 @@
     public boolean initialized;
 
-    private final JSplitPane parent;
+    private final JSplitPane myParent;
 
     /**
@@ -45,5 +45,5 @@
      */
     public DialogsPanel(JSplitPane parent) {
-        this.parent = parent;
+        this.myParent = parent;
     }
 
@@ -192,19 +192,9 @@
          * Determine the panel geometry
          */
-        if (action == Action.RESTORE_SAVED) {
+        if (action == Action.RESTORE_SAVED || action == Action.ELEMENT_SHRINKS) {
             for (int i = 0; i < n; ++i) {
                 final ToggleDialog dlg = allDialogs.get(i);
                 if (dlg.isDialogInDefaultView()) {
-                    final int ph = dlg.getLastHeight();
-                    final int ah = dlg.getSize().height;
-                    dlg.setPreferredSize(new Dimension(Integer.MAX_VALUE, ah < 20 ? ph : ah));
-                }
-            }
-
-        } else if (action == Action.ELEMENT_SHRINKS) {
-            for (int i = 0; i < n; ++i) {
-                final ToggleDialog dlg = allDialogs.get(i);
-                if (dlg.isDialogInDefaultView()) {
-                    final int ph = dlg.getPreferredHeight();
+                    final int ph = action == Action.RESTORE_SAVED ? dlg.getLastHeight() : dlg.getPreferredHeight();
                     final int ah = dlg.getSize().height;
                     dlg.setPreferredSize(new Dimension(Integer.MAX_VALUE, ah < 20 ? ph : ah));
@@ -324,5 +314,5 @@
          */
         if (numPanels == 1 && panels.get(n-1).getComponents().length == 0) {
-            parent.setDividerSize(0);
+            myParent.setDividerSize(0);
             this.setVisible(false);
         } else {
@@ -331,6 +321,6 @@
             }
             this.setVisible(true);
-            parent.setDividerSize(5);
-            parent.resetToPreferredSizes();
+            myParent.setDividerSize(5);
+            myParent.resetToPreferredSizes();
         }
     }
