Ignore:
Timestamp:
2016-06-12T12:00:38+02:00 (9 years ago)
Author:
stoecker
Message:

see #9995 - improve handling for HIDPI screens, patch by strump (modified by me)

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
1 added
6 edited

Legend:

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

    r10356 r10358  
    9292            action.addPropertyChangeListener(propertyChangeListener);
    9393        }
    94         int iconHeight = ImageProvider.ImageSizes.SIDEBUTTON.getImageSize();
     94        int iconHeight = ImageProvider.ImageSizes.SIDEBUTTON.getImageDimension().height;
    9595        Icon i = getIcon();
    9696        if (i instanceof ImageIcon && i.getIconHeight() != iconHeight) {
  • trunk/src/org/openstreetmap/josm/gui/SplashScreen.java

    r10254 r10358  
    99import java.awt.GridBagConstraints;
    1010import java.awt.GridBagLayout;
    11 import java.awt.Image;
    1211import java.awt.Insets;
    1312import java.awt.event.MouseAdapter;
     
    1817
    1918import javax.swing.BorderFactory;
    20 import javax.swing.ImageIcon;
    2119import javax.swing.JFrame;
    2220import javax.swing.JLabel;
     
    7068
    7169        // Add the logo
    72         JLabel logo = new JLabel(new ImageIcon(ImageProvider.get("logo.svg").getImage().getScaledInstance(128, 129, Image.SCALE_SMOOTH)));
     70        JLabel logo = new JLabel(new ImageProvider("logo.svg").setSize(ImageProvider.ImageSizes.SPLASH_LOGO).get());
    7371        GridBagConstraints gbc = new GridBagConstraints();
    7472        gbc.gridheight = 2;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r10325 r10358  
    3434import javax.swing.BorderFactory;
    3535import javax.swing.ButtonGroup;
     36import javax.swing.ImageIcon;
    3637import javax.swing.JButton;
    3738import javax.swing.JCheckBoxMenuItem;
     
    506507
    507508            // scale down the dialog icon
    508             lblTitle = new JLabel("", new ImageProvider("dialogs", iconName).setWidth(16).get(), JLabel.TRAILING);
     509            ImageIcon icon = new ImageProvider("dialogs", iconName).setSize(ImageProvider.ImageSizes.SMALLICON).get();
     510            lblTitle = new JLabel("", icon, JLabel.TRAILING);
    509511            lblTitle.setIconTextGap(8);
    510512
     
    543545            // show the pref button if applicable
    544546            if (preferenceClass != null) {
    545                 JButton pref = new JButton(new ImageProvider("preference").setWidth(16).get());
     547                JButton pref = new JButton(new ImageProvider("preference").setSize(ImageProvider.ImageSizes.SMALLICON).get());
    546548                pref.setToolTipText(tr("Open preferences for this panel"));
    547549                pref.setBorder(BorderFactory.createEmptyBorder());
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r9965 r10358  
    147147    public static ImageIcon getIcon(IconReference ref, int width, int height) {
    148148        final String namespace = ref.source.getPrefName();
    149         ImageIcon i = getIconProvider(ref, false).setWidth(width).setHeight(height).get();
     149        ImageIcon i = getIconProvider(ref, false).setSize(width, height).get();
    150150        if (i == null) {
    151151            Main.warn("Mappaint style \""+namespace+"\" ("+ref.source.getDisplayString()+") icon \"" + ref.iconName + "\" not found.");
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r10212 r10358  
    510510                    // Get icon
    511511                    String iconName = tps.getIconName();
    512                     ImageIcon icon = iconName != null && !iconName.isEmpty() ? ImageProvider.get("preferences", iconName) : null;
    513                     // See #6985 - Force icons to be 48x48 pixels
    514                     if (icon != null && (icon.getIconHeight() != 48 || icon.getIconWidth() != 48)) {
    515                         icon = new ImageIcon(icon.getImage().getScaledInstance(48, 48, Image.SCALE_DEFAULT));
     512                    ImageIcon icon = null;
     513
     514                    if(iconName != null && !iconName.isEmpty()) {
     515                        icon = new ImageProvider("preferences", iconName).setSize(ImageProvider.ImageSizes.SETTINGS_TAB).get();
    516516                    }
    517517                    if (settingsInitialized.contains(tps)) {
  • trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java

    r9231 r10358  
    180180            mi.setText(label);
    181181            if (iconName != null && Main.pref.getBoolean("text.popupmenu.useicons", true)) {
    182                 ImageIcon icon = new ImageProvider(iconName).setWidth(16).get();
     182                ImageIcon icon = new ImageProvider(iconName).setSize(ImageProvider.ImageSizes.SMALLICON).get();
    183183                if (icon != null) {
    184184                    mi.setIcon(icon);
Note: See TracChangeset for help on using the changeset viewer.