Skip to content

[revert] removal of BagdeIcon #8426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@

import okhttp3.internal.immutableListOf
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.changelog.Changelog
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import java.io.File
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import org.jetbrains.changelog.Changelog

// Specify UTF-8 for all compilations so we avoid Windows-1252.
allprojects {
Expand Down Expand Up @@ -186,7 +185,8 @@ intellijPlatform {
VerifyPluginTask.FailureLevel.COMPATIBILITY_PROBLEMS,
// VerifyPluginTask.FailureLevel.DEPRECATED_API_USAGES, // https://github.com/flutter/flutter-intellij/issues/7718
// VerifyPluginTask.FailureLevel.SCHEDULED_FOR_REMOVAL_API_USAGES,
VerifyPluginTask.FailureLevel.EXPERIMENTAL_API_USAGES,
// `BadgeIcon`:
// VerifyPluginTask.FailureLevel.EXPERIMENTAL_API_USAGES,
// VerifyPluginTask.FailureLevel.INTERNAL_API_USAGES,
// VerifyPluginTask.FailureLevel.OVERRIDE_ONLY_API_USAGES,
VerifyPluginTask.FailureLevel.NON_EXTENDABLE_API_USAGES,
Expand All @@ -197,7 +197,7 @@ intellijPlatform {
)
verificationReportsFormats = VerifyPluginTask.VerificationReportsFormats.ALL
subsystemsToCheck = VerifyPluginTask.Subsystems.ALL

ides {
recommended()
}
Expand Down
40 changes: 1 addition & 39 deletions src/io/flutter/toolwindow/ToolWindowBadgeUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowId;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.ui.BadgeIcon;
import io.flutter.run.common.RunMode;
import io.flutter.run.daemon.FlutterApp;

Expand Down Expand Up @@ -51,43 +52,4 @@ else if (app.getMode() == RunMode.DEBUG) {
});
}
}

private static class BadgeIcon implements Icon {
private final Icon baseIcon;
private final Color overlayColor;
private static final float alpha = 1.0F;

public BadgeIcon(Icon baseIcon, Color overlayColor) {
this.baseIcon = baseIcon;
this.overlayColor = overlayColor;
}

@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
baseIcon.paintIcon(c, g, x, y);

Graphics2D g2d = (Graphics2D)g.create();
try {
g2d.translate(x, y);

g2d.setComposite(AlphaComposite.SrcOver.derive(alpha));

g2d.setColor(overlayColor);
g2d.fillRect(0, 0, getIconWidth(), getIconHeight());
}
finally {
g2d.dispose();
}
}

@Override
public int getIconWidth() {
return baseIcon.getIconWidth();
}

@Override
public int getIconHeight() {
return baseIcon.getIconHeight();
}
}
}