Changeset 8358 in josm for trunk/src/org/openstreetmap/josm
- Timestamp:
- 2015-05-16T00:49:42+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r8342 r8358 10 10 import java.awt.GridBagLayout; 11 11 import java.awt.GridLayout; 12 import java.awt.Insets; 12 13 import java.awt.event.ActionEvent; 13 14 import java.awt.event.ActionListener; … … 34 35 import java.util.TreeSet; 35 36 37 import javax.swing.AbstractButton; 38 import javax.swing.BorderFactory; 36 39 import javax.swing.ButtonGroup; 37 40 import javax.swing.Icon; … … 695 698 aibutton.setMargin(new java.awt.Insets(0,0,0,0)); 696 699 aibutton.setFocusable(false); 700 saveHorizontalSpace(aibutton); 697 701 bg.add(aibutton); 698 702 try { … … 731 735 } 732 736 }); 737 saveHorizontalSpace(releasebutton); 733 738 pnl.add(releasebutton, GBC.eol()); 734 739 value = pnl; … … 737 742 p.add(value, GBC.eol().fill(GBC.HORIZONTAL)); 738 743 return true; 744 } 745 746 private static void saveHorizontalSpace(AbstractButton button) { 747 Insets insets = button.getBorder().getBorderInsets(button); 748 // Ensure the current look&feel does not waste horizontal space (as seen in Nimbus & Aqua) 749 if (insets != null && insets.left+insets.right > insets.top+insets.bottom) { 750 int min = Math.min(insets.top, insets.bottom); 751 button.setBorder(BorderFactory.createEmptyBorder(insets.top, min, insets.bottom, min)); 752 } 739 753 } 740 754
Note:
See TracChangeset
for help on using the changeset viewer.