X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=eclipse%2Forg.argeo.cms.swt%2Fsrc%2Forg%2Fargeo%2Fcms%2Fswt%2Fosgi%2FBundleCmsSwtTheme.java;h=c37a5b74476fdd361e951813270914dfcd9096ae;hb=4c7e1885b8bf3c93fa0919ace122e3f289a925ea;hp=b9b2751a7f55dd3772a1bf494a6cdd25ac897aff;hpb=8282011b0e20e80704b209ad55fa9fb132e16280;p=lgpl%2Fargeo-commons.git diff --git a/eclipse/org.argeo.cms.swt/src/org/argeo/cms/swt/osgi/BundleCmsSwtTheme.java b/eclipse/org.argeo.cms.swt/src/org/argeo/cms/swt/osgi/BundleCmsSwtTheme.java index b9b2751a7..c37a5b744 100644 --- a/eclipse/org.argeo.cms.swt/src/org/argeo/cms/swt/osgi/BundleCmsSwtTheme.java +++ b/eclipse/org.argeo.cms.swt/src/org/argeo/cms/swt/osgi/BundleCmsSwtTheme.java @@ -17,7 +17,7 @@ public class BundleCmsSwtTheme extends BundleCmsTheme implements CmsSwtTheme { private Map> iconPaths = new HashMap<>(); - public Image getImage(String path) { + protected Image getImage(String path) { if (!imageCache.containsKey(path)) { try (InputStream in = getResourceAsStream(path)) { if (in == null) @@ -55,11 +55,18 @@ public class BundleCmsSwtTheme extends BundleCmsTheme implements CmsSwtTheme { paths: for (String p : getImagesPaths()) { int lastSlash = p.lastIndexOf('/'); String fileName = p; + String ext = ""; if (lastSlash >= 0) fileName = p.substring(lastSlash + 1); int lastDot = fileName.lastIndexOf('.'); - if (lastDot >= 0) + if (lastDot >= 0) { + ext = fileName.substring(lastDot + 1); fileName = fileName.substring(0, lastDot); + } + + if ("svg".equals(ext)) + continue paths; + if (fileName.equals(name)) {// matched Image img = getImage(p); int width = img.getBounds().width;