Skip to content

Commit 53ddcc6

Browse files
authored
[CQ] migrate from deprecated LayeredIcon constructor (#8203)
Migrate from deprecated `LayeredIcon(...)` to the `layeredIcon` object companion function (now preferred). See: https://github.com/JetBrains/intellij-community/blob/1d1263727bd49f317fdf385e50dded26e98cc76f/platform/core-ui/src/ui/LayeredIcon.kt#L101 --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent 6350319 commit 53ddcc6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

flutter-idea/src/io/flutter/utils/CustomIconMaker.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public Icon getCustomIcon(String fromText, IconKind kind, boolean isAbstract) {
4646

4747
if (!iconCache.containsKey(mapKey)) {
4848
final Icon baseIcon = isAbstract ? kind.abstractIcon : kind.icon;
49-
50-
final Icon icon = new LayeredIcon(baseIcon, new Icon() {
49+
50+
final Icon icon = LayeredIcon.layeredIcon(() -> new Icon[]{baseIcon, new Icon() {
5151
public void paintIcon(Component c, Graphics g, int x, int y) {
5252
final Graphics2D g2 = (Graphics2D)g.create();
5353

@@ -78,7 +78,7 @@ public int getIconWidth() {
7878
public int getIconHeight() {
7979
return baseIcon != null ? baseIcon.getIconHeight() : 13;
8080
}
81-
});
81+
}});
8282

8383
iconCache.put(mapKey, icon);
8484
}

0 commit comments

Comments
 (0)