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