Ignore:
Timestamp:
2014-11-01T23:00:42+01:00 (11 years ago)
Author:
stoecker
Message:

see #10684, see #10688 fix icon scaling a bit

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r7668 r7687  
    124124
    125125        public Icon getDisplayIcon() {
    126             return ico != null ? ico : (Icon) action.getValue(Action.SMALL_ICON);
     126            if(ico != null)
     127                return ico;
     128            Object o = action.getValue(Action.LARGE_ICON_KEY);
     129            if(o == null)
     130                o = action.getValue(Action.SMALL_ICON);
     131            return (Icon) o;
    127132        }
    128133
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r7616 r7687  
    1111import java.awt.Insets;
    1212import java.awt.event.ActionEvent;
     13import java.io.File;
    1314import java.util.ArrayList;
    1415import java.util.Collection;
     
    143144     * Called from the XML parser to set the icon.
    144145     * This task is performed in the background in order to speedup startup.
    145      *
    146      * FIXME for Java 1.6 - use 24x24 icons for LARGE_ICON_KEY (button bar)
    147      * and the 16x16 icons for SMALL_ICON.
    148146     */
    149147    public void setIcon(final String iconName) {
     148        File arch = TaggingPresetReader.getZipIcons();
     149        final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
    150150        ImageProvider imgProv = new ImageProvider(iconName);
    151         final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
    152151        imgProv.setDirs(s);
    153152        imgProv.setId("presets");
    154         imgProv.setArchive(TaggingPresetReader.getZipIcons());
     153        imgProv.setArchive(arch);
    155154        imgProv.setOptional(true);
    156         imgProv.setMaxWidth(16).setMaxHeight(16);
     155        imgProv.setSize(ImageProvider.ImageSizes.SMALLICON);
    157156        imgProv.getInBackground(new ImageProvider.ImageCallback() {
    158157            @Override
     
    167166                } else {
    168167                    Main.warn("Could not get presets icon " + iconName);
     168                }
     169            }
     170        });
     171        imgProv = new ImageProvider(iconName);
     172        imgProv.setDirs(s);
     173        imgProv.setId("presets");
     174        imgProv.setArchive(arch);
     175        imgProv.setOptional(true);
     176        imgProv.setSize(ImageProvider.ImageSizes.LARGEICON);
     177        imgProv.getInBackground(new ImageProvider.ImageCallback() {
     178            @Override
     179            public void finished(final ImageIcon result) {
     180                if (result != null) {
     181                    GuiHelper.runInEDT(new Runnable() {
     182                        @Override
     183                        public void run() {
     184                            putValue(Action.LARGE_ICON_KEY, result);
     185                        }
     186                    });
    169187                }
    170188            }
Note: See TracChangeset for help on using the changeset viewer.