Browse Source

Demo: Only use files which have an svg extension

We need to require the dot or else we might try to load a folder as an icon.
jsvg
weisj 3 years ago committed by Jannis Weis
parent
commit
1bdd7007c1
No known key found for this signature in database
GPG Key ID: 7C9D8D4B558049AB
  1. 2
      core/src/test/java/com/github/weisj/darklaf/icon/AllIcons.java

2
core/src/test/java/com/github/weisj/darklaf/icon/AllIcons.java

@ -99,7 +99,7 @@ public class AllIcons extends BaseComponentDemo {
protected static List<NamedIcon<? extends Icon>> loadIcons(final int displaySize, final boolean centered) {
IconLoader loader = IconLoader.get();
try (ResourceWalker walker = ResourceWalker.walkResources("com.github.weisj")) {
return walker.stream().filter(p -> p.endsWith("svg")).map(p -> {
return walker.stream().filter(p -> p.endsWith(".svg")).map(p -> {
ThemedSVGIcon icon = (ThemedSVGIcon) loader.loadSVGIcon(p, -displaySize, -displaySize, true);
return new NamedIcon<>(p, centered ? new CenterIcon(icon, displaySize, displaySize) : icon);
}).collect(Collectors.groupingBy(pair -> pathToIconName(pair.getFirst())))

Loading…
Cancel
Save