Ignore:
Timestamp:
2021-08-01T19:40:15+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #21176 - fix icon sizes of save layers dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageResource.java

    r17827 r18099  
    1515import javax.swing.JPanel;
    1616import javax.swing.UIManager;
     17
     18import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
    1719
    1820import com.kitfox.svg.SVGDiagram;
     
    101103     */
    102104    public void attachImageIcon(AbstractAction a) {
    103         Dimension iconDimension = ImageProvider.ImageSizes.SMALLICON.getImageDimension();
    104         ImageIcon icon = getImageIcon(iconDimension);
    105         a.putValue(Action.SMALL_ICON, icon);
    106 
    107         iconDimension = ImageProvider.ImageSizes.LARGEICON.getImageDimension();
    108         icon = getImageIcon(iconDimension);
    109         a.putValue(Action.LARGE_ICON_KEY, icon);
     105        a.putValue(Action.SMALL_ICON, getImageIcon(ImageSizes.SMALLICON.getImageDimension()));
     106        a.putValue(Action.LARGE_ICON_KEY, getImageIcon(ImageSizes.LARGEICON.getImageDimension()));
    110107    }
    111108
     
    121118            a.putValue("ImageResource", this);
    122119        }
     120    }
     121
     122    /**
     123     * Returns the {@code ImageResource} attached to the given action, if any.
     124     * @param a action
     125     * @return the {@code ImageResource} attached to the given action, or {@code null}
     126     * @since 18099
     127     */
     128    public static ImageResource getAttachedImageResource(Action a) {
     129        return (ImageResource) a.getValue("ImageResource");
    123130    }
    124131
Note: See TracChangeset for help on using the changeset viewer.