Ticket #12409: IconSizeNotHardcoded.patch

File IconSizeNotHardcoded.patch, 1.9 KB (added by kolesar, 10 years ago)
  • src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java

    diff --git a/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java b/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java
    index 80ef476..3aa3329 100644
    a b package org.openstreetmap.josm.actions.relation;  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    66import java.awt.Component;
     7import java.awt.Dimension;
    78import java.awt.Rectangle;
    89import java.awt.event.ActionEvent;
    910import java.awt.event.ActionListener;
    public class RecentRelationsAction implements ActionListener, CommandQueueListen  
    153154                    menuItem.setAccelerator(keystroke);
    154155                    first = false;
    155156                }
    156                 menuItem.setIcon(ImageProvider.getPadded(relation, new Rectangle(16, 16)));
     157                Dimension dimension = ImageProvider.getImageSizes(ImageProvider.ImageSizes.MENU);
     158                menuItem.setIcon(ImageProvider.getPadded(relation, new Rectangle(dimension.width, dimension.height)));
    157159                add(menuItem);
    158160            }
    159161        }
  • src/org/openstreetmap/josm/tools/ImageProvider.java

    diff --git a/src/org/openstreetmap/josm/tools/ImageProvider.java b/src/org/openstreetmap/josm/tools/ImageProvider.java
    index 828ac94..bc37b55 100644
    a b public class ImageProvider {  
    17681768    }
    17691769
    17701770    /**
    1771      * Determines if the given {@code BufferedImage} has a transparent color determiend by a previous call to {@link #read}.
     1771     * Determines if the given {@code BufferedImage} has a transparent color determined by a previous call to {@link #read}.
    17721772     * @param bi The {@code BufferedImage} to test
    17731773     * @return {@code true} if {@code bi} has a transparent color determined by a previous call to {@code read}.
    17741774     * @see #read