Ticket #15334: 15334.patch

File 15334.patch, 3.6 KB (added by simon04, 7 years ago)
  • src/org/openstreetmap/josm/gui/MapFrame.java

    diff --git a/src/org/openstreetmap/josm/gui/MapFrame.java b/src/org/openstreetmap/josm/gui/MapFrame.java
    index 16621b70e..06b94a4e3 100644
    a b  
    77import java.awt.Component;
    88import java.awt.Container;
    99import java.awt.Dimension;
    10 import java.awt.Font;
    1110import java.awt.GridBagLayout;
    1211import java.awt.Rectangle;
    1312import java.awt.event.ActionEvent;
     
    2524import javax.swing.BorderFactory;
    2625import javax.swing.BoxLayout;
    2726import javax.swing.ButtonGroup;
    28 import javax.swing.ImageIcon;
    2927import javax.swing.JButton;
    3028import javax.swing.JCheckBoxMenuItem;
    3129import javax.swing.JComponent;
     
    3533import javax.swing.JToggleButton;
    3634import javax.swing.JToolBar;
    3735import javax.swing.KeyStroke;
     36import javax.swing.SwingConstants;
    3837import javax.swing.border.Border;
    3938import javax.swing.event.PopupMenuEvent;
    4039import javax.swing.event.PopupMenuListener;
     40import javax.swing.plaf.basic.BasicArrowButton;
    4141import javax.swing.plaf.basic.BasicSplitPaneDivider;
    4242import javax.swing.plaf.basic.BasicSplitPaneUI;
    4343
     
    137137
    138138    private final ListAllButtonsAction listAllDialogsAction = new ListAllButtonsAction(allDialogButtons);
    139139    private final ListAllButtonsAction listAllMapModesAction = new ListAllButtonsAction(allMapModeButtons);
    140     private final JButton listAllToggleDialogsButton = new JButton(listAllDialogsAction);
    141     private final JButton listAllMapModesButton = new JButton(listAllMapModesAction);
     140    private final JButton listAllToggleDialogsButton = new BasicArrowButton(SwingConstants.EAST);
     141    private final JButton listAllMapModesButton = new BasicArrowButton(SwingConstants.EAST);
    142142
    143143    {
    144144        listAllDialogsAction.setButton(listAllToggleDialogsButton);
    public void fillPanel(Container panel) {  
    500500            toolBarActions.setBorder(null);
    501501            toolBarActions.setInheritsPopupMenu(true);
    502502            sideToolBar.add(toolBarActions);
    503             listAllMapModesButton.setAlignmentX(0.5f);
    504             listAllMapModesButton.setBorder(null);
    505             listAllMapModesButton.setFont(listAllMapModesButton.getFont().deriveFont(Font.PLAIN));
    506             listAllMapModesButton.setInheritsPopupMenu(true);
    507503            sideToolBar.add(listAllMapModesButton);
    508504        }
    509505
    public void fillPanel(Container panel) {  
    516512            toolBarToggle.setBorder(null);
    517513            toolBarToggle.setInheritsPopupMenu(true);
    518514            sideToolBar.add(toolBarToggle);
    519             listAllToggleDialogsButton.setAlignmentX(0.5f);
    520             listAllToggleDialogsButton.setBorder(null);
    521             listAllToggleDialogsButton.setFont(listAllToggleDialogsButton.getFont().deriveFont(Font.PLAIN));
    522             listAllToggleDialogsButton.setInheritsPopupMenu(true);
    523515            sideToolBar.add(listAllToggleDialogsButton);
    524516        }
    525517
    public void actionPerformed(ActionEvent e) {  
    642634
    643635        public void setButton(JButton button) {
    644636            this.button = button;
    645             final ImageIcon icon = ImageProvider.get("audio-fwd");
    646             putValue(SMALL_ICON, icon);
    647             button.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight() + 64));
     637            button.setPreferredSize(ImageProvider.ImageSizes.LARGEICON.getImageDimension());
     638            button.setMaximumSize(ImageProvider.ImageSizes.LARGEICON.getImageDimension());
     639            button.setAction(this);
     640            button.setAlignmentX(0.5f);
     641            button.setInheritsPopupMenu(true);
    648642        }
    649643
    650644        @Override