Changeset 5543 in josm for trunk


Ignore:
Timestamp:
2012-10-30T15:40:23+01:00 (11 years ago)
Author:
bastiK
Message:

fixed #8162 - Handling of SVG in ICONS for <combo> <list_entry> </combo>

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r5509 r5543  
    341341
    342342        public ImageIcon getIcon() {
    343             return icon == null ? null : loadImageIcon(icon, zipIcons);
     343            return icon == null ? null : loadImageIcon(icon, zipIcons, 24);
    344344        }
    345345
     
    12641264    }
    12651265
    1266     protected static ImageIcon loadImageIcon(String iconName, File zipIcons) {
     1266    protected static ImageIcon loadImageIcon(String iconName, File zipIcons, Integer maxSize) {
    12671267        final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
    1268         return new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true).get();
     1268        ImageProvider imgProv = new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true);
     1269        if (maxSize != null) {
     1270            imgProv.setMaxSize(24);
     1271        }
     1272        return imgProv.get();
    12691273    }
    12701274
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r5540 r5543  
    197197        this.maxHeight = maxSize.height;
    198198        return this;
     199    }
     200   
     201    /**
     202     * Convenience method, see {@link #setMaxSize(Dimension)}.
     203     */
     204    public ImageProvider setMaxSize(int maxSize) {
     205        return this.setMaxSize(new Dimension(maxSize, maxSize));
    199206    }
    200207
Note: See TracChangeset for help on using the changeset viewer.