Hi,
attached is a small clean up to the ToggleDialog class.
Cheers, detlef
diff -urb --exclude='*.svn*' --exclude='*.jar' --exclude=build josm-svn/core/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java josm-dev/core/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
--- josm-svn/core/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java 2009-01-19 01:39:29.000000000 +0100
+++ josm-dev/core/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java 2009-01-20 20:08:20.000000000 +0100
@@ -93,8 +93,10 @@
// 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);
+ JLabel firstPart = new JLabel(name, smallIcon, JLabel.TRAILING);
+ firstPart.setIconTextGap(8);
+ titleBar.add(firstPart, GBC.std());
+ titleBar.add(Box.createHorizontalGlue(),GBC.std().fill(GBC.HORIZONTAL));
final ActionListener hideActionListener = new ActionListener(){
public void actionPerformed(ActionEvent e) {
@@ -144,15 +146,6 @@
};
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"));
_______________________________________________
josm-dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/josm-dev