mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-15 13:55:03 -05:00
Use @2x window icons
This commit is contained in:
parent
5d258787f8
commit
8667c0715a
@ -4,7 +4,6 @@ import static java.util.Collections.*;
|
|||||||
import static java.util.stream.Collectors.*;
|
import static java.util.stream.Collectors.*;
|
||||||
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.awt.Toolkit;
|
|
||||||
import java.awt.image.BaseMultiResolutionImage;
|
import java.awt.image.BaseMultiResolutionImage;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -35,22 +34,17 @@ public final class ResourceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Stream<URL> getApplicationIconResources() {
|
public static Stream<URL> getApplicationIconResources() {
|
||||||
return Stream.of("window.icon.large", "window.icon.medium", "window.icon.small").map(ResourceManager::getImageResource);
|
return Stream.of("window.icon16", "window.icon64").map(ResourceManager::getImageResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Image> getApplicationIconImages() {
|
public static List<Image> getApplicationIconImages() {
|
||||||
return getApplicationIconResources().map(ResourceManager::getToolkitImage).collect(toList());
|
return Stream.of("window.icon16", "window.icon64").map(ResourceManager::getMultiResolutionImageResource).map(ResourceManager::getMultiResolutionImage).collect(toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Icon getFlagIcon(String languageCode) {
|
public static Icon getFlagIcon(String languageCode) {
|
||||||
return getIcon("flags/" + languageCode);
|
return getIcon("flags/" + languageCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Image getToolkitImage(URL resource) {
|
|
||||||
// load sun.awt.image.ToolkitImage or sun.awt.image.MultiResolutionToolkitImage (via @2x convention)
|
|
||||||
return Toolkit.getDefaultToolkit().getImage(resource);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Image getMultiResolutionImage(URL[] resource) {
|
private static Image getMultiResolutionImage(URL[] resource) {
|
||||||
try {
|
try {
|
||||||
Image[] image = new Image[resource.length];
|
Image[] image = new Image[resource.length];
|
||||||
|
Loading…
Reference in New Issue
Block a user