Changeset 15781 in josm for trunk/src/org
- Timestamp:
- 2020-01-26T21:06:28+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r15633 r15781 8 8 import java.awt.Container; 9 9 import java.awt.Dimension; 10 import java.awt.Font;11 10 import java.awt.GridBagLayout; 12 11 import java.awt.Rectangle; … … 27 26 import javax.swing.BoxLayout; 28 27 import javax.swing.ButtonGroup; 29 import javax.swing.ImageIcon;30 28 import javax.swing.InputMap; 31 29 import javax.swing.JButton; … … 38 36 import javax.swing.JToolBar; 39 37 import javax.swing.KeyStroke; 38 import javax.swing.SwingConstants; 40 39 import javax.swing.border.Border; 41 40 import javax.swing.event.PopupMenuEvent; 42 41 import javax.swing.event.PopupMenuListener; 42 import javax.swing.plaf.basic.BasicArrowButton; 43 43 import javax.swing.plaf.basic.BasicSplitPaneDivider; 44 44 import javax.swing.plaf.basic.BasicSplitPaneUI; … … 139 139 private final ListAllButtonsAction listAllDialogsAction = new ListAllButtonsAction(allDialogButtons); 140 140 private final ListAllButtonsAction listAllMapModesAction = new ListAllButtonsAction(allMapModeButtons); 141 private final JButton listAllToggleDialogsButton = new JButton(listAllDialogsAction);142 private final JButton listAllMapModesButton = new JButton(listAllMapModesAction);143 144 {145 listAllDialogsAction.setButton(listAllToggleDialogsButton);146 listAllMapModesAction.setButton(listAllMapModesButton);147 }148 141 149 142 // Toggle dialogs … … 521 514 toolBarActions.setInheritsPopupMenu(true); 522 515 sideToolBar.add(toolBarActions); 523 listAllMapModesButton.setAlignmentX(0.5f); 524 listAllMapModesButton.setBorder(null); 525 listAllMapModesButton.setFont(listAllMapModesButton.getFont().deriveFont(Font.PLAIN)); 526 listAllMapModesButton.setInheritsPopupMenu(true); 527 sideToolBar.add(listAllMapModesButton); 516 sideToolBar.add(listAllMapModesAction.createButton()); 528 517 } 529 518 … … 537 526 toolBarToggle.setInheritsPopupMenu(true); 538 527 sideToolBar.add(toolBarToggle); 539 listAllToggleDialogsButton.setAlignmentX(0.5f); 540 listAllToggleDialogsButton.setBorder(null); 541 listAllToggleDialogsButton.setFont(listAllToggleDialogsButton.getFont().deriveFont(Font.PLAIN)); 542 listAllToggleDialogsButton.setInheritsPopupMenu(true); 543 sideToolBar.add(listAllToggleDialogsButton); 528 sideToolBar.add(listAllDialogsAction.createButton()); 544 529 } 545 530 … … 661 646 } 662 647 663 public void setButton(JButton button) { 664 this.button = button; 665 final ImageIcon icon = ImageProvider.get("audio-fwd"); 666 putValue(SMALL_ICON, icon); 667 button.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight() + 64)); 648 JButton createButton() { 649 button = new BasicArrowButton(SwingConstants.EAST) { 650 651 @Override 652 public Dimension getMaximumSize() { 653 final Dimension dimension = ImageProvider.ImageSizes.TOOLBAR.getImageDimension(); 654 dimension.width = Integer.MAX_VALUE; 655 return dimension; 656 } 657 }; 658 button.setAction(this); 659 button.setAlignmentX(0.5f); 660 button.setInheritsPopupMenu(true); 661 return button; 668 662 } 669 663
Note:
See TracChangeset
for help on using the changeset viewer.