Fix subtitle source icon lookup
This commit is contained in:
parent
a6df6e02a7
commit
754a473316
|
@ -27,6 +27,10 @@ public final class ResourceManager {
|
|||
}
|
||||
|
||||
private static Icon getIcon(List<String> icons) {
|
||||
if (icons.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return cache.computeIfAbsent(icons.get(0), i -> {
|
||||
// load image
|
||||
URL[] resource = getMultiResolutionImageResource(i);
|
||||
|
@ -35,11 +39,7 @@ public final class ResourceManager {
|
|||
}
|
||||
|
||||
// try next image
|
||||
if (icons.size() > 0) {
|
||||
return getIcon(icons.subList(1, icons.size()));
|
||||
}
|
||||
|
||||
return null;
|
||||
return getIcon(icons.subList(1, icons.size()));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ import java.util.logging.Level;
|
|||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.DefaultCellEditor;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
|
@ -169,8 +168,8 @@ class SubtitleAutoMatchDialog extends JDialog {
|
|||
}
|
||||
|
||||
protected void addSubtitleService(final SubtitleServiceBean service, final JPanel servicePanel) {
|
||||
final LinkButton component = new LinkButton(service.getDescription(), null, ResourceManager.getIcon("database"), service.getLink());
|
||||
component.setBorder(BorderFactory.createEmptyBorder());
|
||||
LinkButton component = new LinkButton(service.getDescription(), null, ResourceManager.getIcon("database.go"), service.getLink());
|
||||
component.setBorder(createEmptyBorder());
|
||||
component.setVisible(false);
|
||||
|
||||
service.addPropertyChangeListener(evt -> {
|
||||
|
|
Loading…
Reference in New Issue