Changeset 30806 in osm for applications/editors


Ignore:
Timestamp:
2014-11-18T23:03:38+01:00 (10 years ago)
Author:
donvip
Message:

[josm_opendata] see #josm10684 - remove hardcoded icon sizes

Location:
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/actions/OpenPreferencesActions.java

    r30723 r30806  
    55
    66import java.awt.event.ActionEvent;
     7import java.awt.event.KeyEvent;
    78
    89import org.openstreetmap.josm.Main;
     
    1112import org.openstreetmap.josm.plugins.opendata.core.OdConstants;
    1213import org.openstreetmap.josm.plugins.opendata.core.gui.OdPreferenceSetting;
    13 import org.openstreetmap.josm.tools.ImageProvider;
     14import org.openstreetmap.josm.tools.Shortcut;
    1415
    1516public class OpenPreferencesActions extends JosmAction {
    1617   
    1718    public OpenPreferencesActions() {
    18         super(false);
    19         putValue(NAME, tr("OpenData preferences"));
    20         putValue(SMALL_ICON, ImageProvider.get("dialogs", OdConstants.ICON_CORE_24));
    21         putValue("toolbar", "opendata_open_preferences");
     19        super(tr("OpenData preferences"), OdConstants.ICON_CORE_24, null,
     20                Shortcut.registerShortcut("opendata_open_preferences", tr("OpenData preferences"),
     21                KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true, false);
    2222    }
    2323   
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleInformation.java

    r30795 r30806  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.awt.Dimension;
    67import java.awt.Image;
    78import java.io.File;
     
    2829import org.openstreetmap.josm.plugins.opendata.core.util.OdUtils;
    2930import org.openstreetmap.josm.tools.ImageProvider;
     31import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
    3032import org.openstreetmap.josm.tools.LanguageInfo;
    3133
     
    328330
    329331    public ImageIcon getScaledIcon() {
    330         if (icon == null)
    331             return OdUtils.getImageIcon(OdConstants.ICON_EMPTY_24);
    332         return new ImageIcon(icon.getImage().getScaledInstance(24, 24, Image.SCALE_SMOOTH));
     332        Dimension dim = ImageProvider.getImageSizes(ImageSizes.MENU);
     333        ImageIcon iconToScale = icon != null ? icon : OdUtils.getImageIcon(OdConstants.ICON_EMPTY_24);
     334        return new ImageIcon(iconToScale.getImage().getScaledInstance(dim.width, dim.height, Image.SCALE_SMOOTH));
    333335    }
    334336}
Note: See TracChangeset for help on using the changeset viewer.