mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Turn to lazy add laf listener
GitOrigin-RevId: c2fe2f5f46172c64cbed8ef6b3db3ea7a6fe7e71
This commit is contained in:
committed by
intellij-monorepo-bot
parent
544c7a4f99
commit
ddf6cc5b60
@@ -6,6 +6,7 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.InstalledPluginsState;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.ide.ui.LafManager;
|
||||
import com.intellij.ide.ui.LafManagerListener;
|
||||
import com.intellij.openapi.application.*;
|
||||
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -49,9 +50,11 @@ public class PluginLogo {
|
||||
private static PluginLogoIconProvider Default;
|
||||
private static List<Pair<IdeaPluginDescriptor, LazyPluginLogoIcon>> myPrepareToLoad;
|
||||
|
||||
static {
|
||||
if (!GraphicsEnvironment.isHeadless()) {
|
||||
LafManager.getInstance().addLafManagerListener(_0 -> {
|
||||
private static LafManagerListener myLafListener;
|
||||
|
||||
private static void initLafListener() {
|
||||
if (myLafListener == null && !GraphicsEnvironment.isHeadless()) {
|
||||
LafManager.getInstance().addLafManagerListener(myLafListener = _0 -> {
|
||||
Default = null;
|
||||
HiDPIPluginLogoIcon.clearCache();
|
||||
});
|
||||
@@ -60,6 +63,7 @@ public class PluginLogo {
|
||||
|
||||
@NotNull
|
||||
public static Icon getIcon(@NotNull IdeaPluginDescriptor descriptor, boolean big, boolean jb, boolean error, boolean disabled) {
|
||||
initLafListener();
|
||||
return getIcon(descriptor).getIcon(big, jb, error, disabled);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user