diff --git a/src/main/java/org/jboss/tools/intellij/openshift/tree/application/DescriptorFactory.java b/src/main/java/org/jboss/tools/intellij/openshift/tree/application/DescriptorFactory.java index 064896931..6eeed6c3d 100644 --- a/src/main/java/org/jboss/tools/intellij/openshift/tree/application/DescriptorFactory.java +++ b/src/main/java/org/jboss/tools/intellij/openshift/tree/application/DescriptorFactory.java @@ -13,8 +13,10 @@ import com.intellij.ide.util.treeView.NodeDescriptor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.IconLoader; +import com.intellij.util.IconUtil; import com.redhat.devtools.intellij.common.tree.LabelAndIconDescriptor; -import org.jboss.tools.intellij.openshift.ui.SwingUtils; +import java.util.function.Supplier; +import javax.swing.Icon; import org.jboss.tools.intellij.openshift.ui.helm.ChartIcons; import org.jboss.tools.intellij.openshift.utils.odo.Binding; import org.jboss.tools.intellij.openshift.utils.odo.Component; @@ -23,9 +25,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import javax.swing.Icon; -import java.util.function.Supplier; - public class DescriptorFactory { private static final Supplier CLUSTER_ICON = () -> IconLoader.findIcon("/images/cluster.svg", ApplicationsTreeStructure.class); @@ -161,7 +160,7 @@ public class DescriptorFactory { releaseNode, releaseNode::getName, () -> "Helm Release", - () -> SwingUtils.scaleIcon(ICON_WIDTH, ChartIcons.getIcon(releaseNode.getRelease())), + () -> IconUtil.resizeSquared(ChartIcons.getIcon(releaseNode.getRelease()), ICON_WIDTH), parentDescriptor); } else if (element instanceof HelmRepositoriesNode) { HelmRepositoriesNode helmRepositoriesNode = (HelmRepositoriesNode) element; @@ -170,7 +169,7 @@ public class DescriptorFactory { helmRepositoriesNode, helmRepositoriesNode::getName, () -> "Repositories", - () -> SwingUtils.scaleIcon(ICON_WIDTH, ChartIcons.getHelmIcon()), + () -> IconUtil.resizeSquared(ChartIcons.getHelmIcon(), ICON_WIDTH), parentDescriptor); } else if (element instanceof HelmRepositoryNode) { HelmRepositoryNode helmRepositoryNode = (HelmRepositoryNode) element; diff --git a/src/main/java/org/jboss/tools/intellij/openshift/ui/helm/ChartIcons.java b/src/main/java/org/jboss/tools/intellij/openshift/ui/helm/ChartIcons.java index 43afa2bbb..ae26b50d8 100644 --- a/src/main/java/org/jboss/tools/intellij/openshift/ui/helm/ChartIcons.java +++ b/src/main/java/org/jboss/tools/intellij/openshift/ui/helm/ChartIcons.java @@ -22,9 +22,10 @@ public class ChartIcons { private static final Path BASE_PATH = Paths.get("images", "helm"); - private static final String HELM_ICON = "helm.png"; + private static final String HELM_ICON = "helm.svg"; public static Icon getHelmIcon() { + // IC-2023.3: IconManager.getInstance().getIcon(BASE_PATH.resolve(HELM_ICON_SVG).toString(), ChartIcons.class.getClassLoader()) return IconManager.getInstance().getIcon(BASE_PATH.resolve(HELM_ICON).toString(), ChartIcons.class); } @@ -41,8 +42,9 @@ private static Icon getIcon(String name) { .filter((IconExpression available) -> available.isMatching(name)) .findFirst(); return found + // IC-2023.3: IconManager.getInstance().getIcon(BASE_PATH.resolve(HELM_ICON_SVG).toString(), ChartIcons.class.getClassLoader()) .map(iconExpression -> IconManager.getInstance().getIcon(iconExpression.filename, ChartIcons.class)) - .orElseGet(ChartIcons::getHelmIcon); + .orElseGet(ChartIcons::getHelmIcon); } private enum IconExpression { diff --git a/src/main/resources/images/helm/helm.png b/src/main/resources/images/helm/helm.png deleted file mode 100644 index 3e5981e39..000000000 Binary files a/src/main/resources/images/helm/helm.png and /dev/null differ diff --git a/src/main/resources/images/helm/helm.svg b/src/main/resources/images/helm/helm.svg index 90f2df543..7f4272251 100644 --- a/src/main/resources/images/helm/helm.svg +++ b/src/main/resources/images/helm/helm.svg @@ -1,12 +1,12 @@ + inkscape:current-layer="g12" /> @@ -52,65 +52,70 @@ - - + - - + id="path3" + style="stroke-width:0.935414" /> + + + + + + + d="m 251.46701,173.09985 c -20.23008,-33.60997 -56.88957,-56.06791 -98.75578,-56.06791 -40.7208,0 -76.515877,21.2459 -97.058696,53.33459 m 2.198111,129.16953 c 20.840303,30.2327 55.555905,50.02659 94.860585,50.02659 39.3761,0 74.14642,-19.86588 94.97405,-50.19149" + mask="url(#a)" + stroke="#0f1689" + stroke-width="20" + id="path7" /> - - - + transform="matrix(0.87499999,0,0,1,11.92319,1.4460715e-7)" + id="g11"> + + + + + - - + d="m 251.46701,170.64039 c -20.23008,-33.60997 -56.88957,-56.06791 -98.75578,-56.06791 -40.7208,0 -76.515877,21.2459 -97.058696,53.33459 m 2.198111,129.16953 c 20.840303,30.2327 55.555905,50.02659 94.860585,50.02659 39.3761,0 74.14642,-19.86588 94.97405,-50.19149" + mask="url(#b)" + stroke="#0f1689" + stroke-width="20" + id="path11" /> -