* experiment with high-dpi icons

This commit is contained in:
Reinhard Pointner 2015-11-20 08:12:04 +00:00
parent 6c85adb431
commit 5b25895808
2 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package net.filebot;
import static java.util.Arrays.*; import static java.util.Arrays.*;
import java.awt.Image; import java.awt.Image;
import java.awt.Toolkit;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.List; import java.util.List;
@ -20,10 +21,17 @@ public final class ResourceManager {
public static Icon getIcon(String name, String def) { public static Icon getIcon(String name, String def) {
URL resource = getImageResource(name, def); URL resource = getImageResource(name, def);
if (resource == null) if (resource == null) {
return null; return null;
}
return new ImageIcon(resource); if (Settings.isMacApp()) {
// load sun.awt.image.ToolkitImage or sun.awt.image.MultiResolutionToolkitImage (via @2x convention)
Image image = Toolkit.getDefaultToolkit().getImage(resource);
return new ImageIcon(image);
} else {
return new ImageIcon(resource);
}
} }
public static List<Image> getApplicationIcons() { public static List<Image> getApplicationIcons() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB