Browse Source

Pull request #13323: REPORT-99485 fix:灰化图标无法跟随DPI变化

Merge in DESIGN/design from ~VITO/c-design:newui to newui

* commit '9cde4b21052368e1f21ce0b7d80657e0f5339358':
  REPORT-99485 fix:灰化图标无法跟随DPI变化
newui
vito-刘恒霖 1 year ago
parent
commit
c06c3318e7
  1. 5
      designer-base/src/main/java/com/fine/theme/icon/IconManager.java
  2. 8
      designer-base/src/main/java/com/fine/theme/icon/UrlIconResource.java

5
designer-base/src/main/java/com/fine/theme/icon/IconManager.java

@ -25,9 +25,7 @@ public class IconManager {
public static boolean initialized = false;
public static ArrayList<IconSet> iconSets = new ArrayList<>(2);
;
public static HashMap<String, WeakReference<Icon>> cache = new HashMap<>(60);
;
public static HashMap<String, WeakReference<Icon>> disableCache = new HashMap<>(60);
@ -130,6 +128,7 @@ public class IconManager {
*/
public static void clearCache() {
cache.clear();
disableCache.clear();
}
/**
@ -137,11 +136,13 @@ public class IconManager {
*/
public static void clearIconCache(String id) {
cache.remove(id);
disableCache.remove(id);
}
private static void clearIconSetCache(@NotNull IconSet set) {
for (String id : set.getIds()) {
cache.remove(id);
disableCache.remove(id);
}
}
}

8
designer-base/src/main/java/com/fine/theme/icon/UrlIconResource.java

@ -6,6 +6,7 @@ import com.fr.third.errorprone.annotations.Immutable;
import org.jetbrains.annotations.NotNull;
import java.io.InputStream;
import java.util.StringJoiner;
/**
* url图标资源
@ -42,4 +43,11 @@ public class UrlIconResource implements IconResource {
InputStream inputStream = IOUtils.getInputStream(path);
return inputStream != null ? inputStream : ResourceIOUtils.read(path);
}
@Override
public String toString() {
return new StringJoiner(", ", UrlIconResource.class.getSimpleName() + "[", "]")
.add("path='" + path + "'")
.toString();
}
}

Loading…
Cancel
Save