diff --git a/property-loader/src/main/java/com/github/weisj/darklaf/icons/CustomThemedIcon.java b/property-loader/src/main/java/com/github/weisj/darklaf/icons/CustomThemedIcon.java index c0c6b653..bdef8918 100644 --- a/property-loader/src/main/java/com/github/weisj/darklaf/icons/CustomThemedIcon.java +++ b/property-loader/src/main/java/com/github/weisj/darklaf/icons/CustomThemedIcon.java @@ -45,6 +45,16 @@ public class CustomThemedIcon extends ThemedSVGIcon { } } + protected CustomThemedIcon(final int width, final int height, final CustomThemedIcon icon) { + super(width, height, icon); + this.defaults = icon.defaults; + } + + @Override + public CustomThemedIcon derive(final int width, final int height) { + return new CustomThemedIcon(width, height, this); + } + @Override protected SVGIcon createSVGIcon() { SVGIcon icon = new SVGIcon(); diff --git a/property-loader/src/main/java/com/github/weisj/darklaf/icons/DarkSVGIcon.java b/property-loader/src/main/java/com/github/weisj/darklaf/icons/DarkSVGIcon.java index 084f8d17..097475dd 100644 --- a/property-loader/src/main/java/com/github/weisj/darklaf/icons/DarkSVGIcon.java +++ b/property-loader/src/main/java/com/github/weisj/darklaf/icons/DarkSVGIcon.java @@ -56,7 +56,7 @@ public class DarkSVGIcon implements DerivableIcon, RotateIcon, Seri private final Dimension size; private final SVGIcon icon; - protected final URI uri; + private final URI uri; private final AtomicBoolean loaded; private boolean loadedWithExtraScale; @@ -80,7 +80,7 @@ public class DarkSVGIcon implements DerivableIcon, RotateIcon, Seri loaded = new AtomicBoolean(false); } - private DarkSVGIcon(final int width, final int height, final DarkSVGIcon icon) { + protected DarkSVGIcon(final int width, final int height, final DarkSVGIcon icon) { this.size = new Dimension(width, height); this.icon = icon.icon; this.uri = icon.uri; @@ -148,7 +148,7 @@ public class DarkSVGIcon implements DerivableIcon, RotateIcon, Seri } } - private String getName() { + protected String getName() { String name = uri.toASCIIString(); name = name.substring(Math.min(name.length() - 1, name.lastIndexOf('/') + 1)); return name; diff --git a/property-loader/src/main/java/com/github/weisj/darklaf/icons/ThemedSVGIcon.java b/property-loader/src/main/java/com/github/weisj/darklaf/icons/ThemedSVGIcon.java index c629f0f5..58b03e5b 100644 --- a/property-loader/src/main/java/com/github/weisj/darklaf/icons/ThemedSVGIcon.java +++ b/property-loader/src/main/java/com/github/weisj/darklaf/icons/ThemedSVGIcon.java @@ -39,6 +39,17 @@ public class ThemedSVGIcon extends DarkSVGIcon implements ThemedIcon { currentTheme = new Object(); } + protected ThemedSVGIcon(final int width, final int height, final ThemedSVGIcon icon) { + super(width, height, icon); + this.currentTheme = icon.currentTheme; + this.updatedNotDuringPaint = icon.updatedNotDuringPaint; + } + + @Override + public ThemedSVGIcon derive(final int width, final int height) { + return new ThemedSVGIcon(width, height, this); + } + @Override protected boolean ensureLoaded(final boolean painting) { /*