Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java	(revision 1227)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java	(revision 1228)
@@ -60,4 +60,9 @@
 
     private void buildList() {
+        if(Main.main.undoRedo.commands.size() != 0) {
+            setTitle(tr("Command Stack: {0}", Main.main.undoRedo.commands.size()), true);
+        } else {
+            setTitle(tr("Command Stack"), false);
+        }
         if (Main.map == null || Main.map.mapView == null || Main.map.mapView.editLayer == null)
             return;
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java	(revision 1227)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java	(revision 1228)
@@ -130,4 +130,10 @@
             if (osm instanceof Relation)
                 model.addElement(osm);
+
+        if(model.size() != 0) {
+            setTitle(tr("Conflicts: {0}", model.size()), true);
+        } else {
+            setTitle(tr("Conflicts"), false);
+        }
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 1227)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 1228)
@@ -286,4 +286,10 @@
         downButton.setEnabled(sel >= 0 && sel < model.getSize()-1);
         deleteAction.setEnabled(!model.isEmpty());
+        
+        if(model.getSize() != 0) {
+            setTitle(tr("Layers: {0}", model.getSize()), true);
+        } else {
+            setTitle(tr("Layers"), false);
+        }
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 1227)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 1228)
@@ -695,4 +695,12 @@
 
         membershipTable.getTableHeader().setVisible(membershipData.getRowCount() > 0);
-    }
+
+        if(propertyData.getRowCount() != 0 || membershipData.getRowCount() != 0) {
+            setTitle(tr("Properties: {0} / Memberships: {1}", 
+                propertyData.getRowCount(), membershipData.getRowCount()), true);
+        } else {
+            setTitle(tr("Properties / Memberships"), false);
+        }
+
+	}
 }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 1227)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 1228)
@@ -122,4 +122,10 @@
         }
         list.setSize(i);
+
+        if(Main.ds.relations.size() != 0) {
+            setTitle(tr("Relations: {0}", Main.ds.relations.size()), true);
+        } else {
+            setTitle(tr("Relations"), false);
+        }
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 1227)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 1228)
@@ -262,4 +262,22 @@
                 selectionHistory.removeLast();
         }
+        
+        int ways = 0;
+        int nodes = 0;
+        int relations = 0;
+        for (OsmPrimitive o : newSelection) {
+            if (o instanceof Way)
+                ways++;
+            else if (o instanceof Node)
+                nodes++;
+            else if (o instanceof Relation)
+                relations++;
+        }
+
+        if( (nodes+ways+relations) != 0) {
+            setTitle(tr("Selection: Rel.: {0} / Ways: {1} / Nodes: {2}", relations, ways, nodes), true);
+        } else {
+            setTitle(tr("Selection"), false);
+        }
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 1227)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 1228)
@@ -1,4 +1,6 @@
 // License: GPL. Copyright 2007 by Immanuel Scholz and others
 package org.openstreetmap.josm.gui.dialogs;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.awt.BorderLayout;
@@ -6,8 +8,12 @@
 import java.awt.EventQueue;
 import java.awt.GridBagLayout;
+import java.awt.Component;
+import java.awt.Image;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.ComponentAdapter;
 import java.awt.event.ComponentEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
@@ -20,4 +26,5 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.ImageIcon;
 
 import org.openstreetmap.josm.Main;
@@ -61,4 +68,5 @@
     public JPanel parent;
     private final JPanel titleBar = new JPanel(new GridBagLayout());
+    public JLabel label = new JLabel();
 
     public ToggleDialog(final String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight) {
@@ -68,5 +76,5 @@
     }
 
-    private void ToggleDialogInit(final String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight) {
+    private void ToggleDialogInit(final String name, String iconName, String tooltip, Shortcut shortcut, final int preferredHeight) {
         setPreferredSize(new Dimension(330,preferredHeight));
         action = new ToggleDialogAction(name, "dialogs/"+iconName, tooltip, shortcut, iconName);
@@ -75,8 +83,71 @@
         setLayout(new BorderLayout());
 
-        titleBar.add(new JLabel(name), GBC.std());
+        // show the minimize button
+        final JLabel minimize = new JLabel(ImageProvider.get("misc", "normal"));
+        titleBar.add(minimize);
+        
+        // scale down the dialog icon
+        ImageIcon inIcon = ImageProvider.get("dialogs", iconName);
+        ImageIcon smallIcon = new ImageIcon(inIcon.getImage().getScaledInstance(16 , 16, Image.SCALE_SMOOTH));
+        JLabel labelSmallIcon = new JLabel(smallIcon);
+        titleBar.add(labelSmallIcon);
+
+        final ActionListener hideActionListener = new ActionListener(){
+            public void actionPerformed(ActionEvent e) {
+                boolean nowVisible = false;
+                Component comps[] = getComponents();
+                for(int i=0; i<comps.length; i++)
+                {
+                    if(comps[i] != titleBar)
+                    {
+                        if(comps[i].isVisible()) {
+                            comps[i].setVisible(false);
+                        } else {
+                            comps[i].setVisible(true);
+                            nowVisible = true;
+                        }
+                    }
+                }
+                
+                Main.pref.put(action.prefname+".minimized", !nowVisible);
+                if(nowVisible == true) {
+                    setPreferredSize(new Dimension(330,preferredHeight));
+                    setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
+                    minimize.setIcon(ImageProvider.get("misc", "normal"));
+                } else {
+                    setPreferredSize(new Dimension(330,20));
+                    setMaximumSize(new Dimension(330,20));
+                    minimize.setIcon(ImageProvider.get("misc", "minimized"));
+                }
+                // doLayout() - workaround
+                parent.setVisible(false);
+                parent.setVisible(true);
+            }
+        };
+        //hide.addActionListener(hideActionListener);
+
+        final MouseListener titleMouseListener = new MouseListener(){
+            public void mouseClicked(MouseEvent e) {
+                hideActionListener.actionPerformed(null);
+            }
+            public void mouseEntered(MouseEvent e) {}
+            public void mouseExited(MouseEvent e) {}
+            public void mousePressed(MouseEvent e) {}
+        public void mouseReleased(MouseEvent e) {}
+        };
+        titleBar.addMouseListener(titleMouseListener);
+
+        // add some padding space (there must be a better way to do this!)
+        JLabel padding = new JLabel(" ");
+        titleBar.add(padding);
+
+        // show the title label
+        label.setText(name);
+        titleBar.add(label, GBC.std());
         titleBar.add(Box.createHorizontalGlue(),GBC.std().fill(GBC.HORIZONTAL));
 
+        // show the sticky button
         JButton sticky = new JButton(ImageProvider.get("misc", "sticky"));
+        sticky.setToolTipText(tr("Undock the panel"));
         sticky.setBorder(BorderFactory.createEmptyBorder());
         final ActionListener stickyActionListener = new ActionListener(){
@@ -121,7 +192,21 @@
         };
         sticky.addActionListener(stickyActionListener);
-
         titleBar.add(sticky);
+
+        // show the close button
+        JButton close = new JButton(ImageProvider.get("misc", "close"));
+        close.setToolTipText(tr("Close this panel. You can reopen it with the buttons in the left toolbar"));
+        close.setBorder(BorderFactory.createEmptyBorder());
+        final ActionListener closeActionListener = new ActionListener(){
+            public void actionPerformed(ActionEvent e) {
+                // fake an event to toggle dialog
+                action.actionPerformed(new ActionEvent(titleBar, 0, ""));
+            }
+        };
+        close.addActionListener(closeActionListener);
+        titleBar.add(close);
+
         add(titleBar, BorderLayout.NORTH);
+        titleBar.setToolTipText(tr("Click to minimize/maximize the panel content"));
 
         setVisible(false);
@@ -135,4 +220,19 @@
             });
         }
+        if (Main.pref.getBoolean(action.prefname+".minimized", false)) {
+            EventQueue.invokeLater(new Runnable(){
+                public void run() {
+                    titleMouseListener.mouseClicked(null);
+                }
+            });
+        }
+    }
+
+    public void setTitle(String title, boolean active) {
+        if(active) {
+            label.setText("<html><b>" + title + "</b>");
+        } else {
+            label.setText(title);
+        }
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 1227)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 1228)
@@ -109,4 +109,10 @@
             data.addRow(new Object[] { uc.user.name, uc.count, uc.count * 100 / all });
         }
+
+        if(ucArr.length != 0) {
+            setTitle(tr("Authors: {0}", ucArr.length), true);
+        } else {
+            setTitle(tr("Authors"), false);
+        }
     }
 
