Skip to content

Commit

Permalink
Merge pull request #2372 from Haehnchen/feature/layered-icon-deprecated
Browse files Browse the repository at this point in the history
replace deprecataed "new LayeredIcon" usages
  • Loading branch information
Haehnchen committed May 13, 2024
2 parents 46b065c + cba4358 commit 41d9e05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private Icon getFileIcon() {

if (rootDir != null && isSymfonyTranslationDirectory()) {
SizedIcon sizedIcon = new SizedIcon(Symfony2Icons.SYMFONY_LINE_MARKER, fileIcon.getIconWidth() / 2, fileIcon.getIconHeight() / 2);
LayeredIcon icon = new LayeredIcon(fileIcon, sizedIcon);
LayeredIcon icon = LayeredIcon.layeredIcon(new Icon[]{fileIcon, sizedIcon});
icon.setIcon(sizedIcon, 1, SwingConstants.SOUTH_EAST);
return icon;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ public Icon getIcon(@NotNull PsiElement element, @Iconable.IconFlags int flags)
// attach controller icon overlay
LayeredIcon icon = null;
if (hasController((TwigFile) element)) {
icon = new LayeredIcon(TwigIcons.TwigFileIcon, Symfony2Icons.TWIG_CONTROLLER_FILE);
icon = LayeredIcon.layeredIcon(new Icon[]{TwigIcons.TwigFileIcon, Symfony2Icons.TWIG_CONTROLLER_FILE});
icon.setIcon(Symfony2Icons.TWIG_CONTROLLER_FILE, 1, SwingConstants.NORTH_WEST);
}

// file provides extends tag, add another layer on top; but put the layer below the previous layer if provided
if (hasFileExtendsTag(element)) {
if (icon == null) {
// we are alone so just place the icon
icon = new LayeredIcon(TwigIcons.TwigFileIcon, Symfony2Icons.TWIG_EXTENDS_FILE);
icon = LayeredIcon.layeredIcon(new Icon[]{TwigIcons.TwigFileIcon, Symfony2Icons.TWIG_EXTENDS_FILE});
icon.setIcon(Symfony2Icons.TWIG_EXTENDS_FILE, 1, SwingConstants.NORTH_WEST);
} else {
// icon should be below first one
icon = new LayeredIcon(icon, Symfony2Icons.TWIG_IMPLEMENTS_FILE);
LayeredIcon.layeredIcon(new Icon[]{Symfony2Icons.TWIG_IMPLEMENTS_FILE});
icon.setIcon(Symfony2Icons.TWIG_EXTENDS_FILE, 1, 0, Symfony2Icons.TWIG_CONTROLLER_FILE.getIconHeight() + 1);
}
}
Expand Down

0 comments on commit 41d9e05

Please sign in to comment.