mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-142968 Auto-completion list on black background since latest EAP build
This commit is contained in:
+13
-13
@@ -36,14 +36,15 @@ import com.intellij.ui.components.JBList;
|
||||
import com.intellij.ui.speedSearch.SpeedSearchUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.FList;
|
||||
import com.intellij.util.ui.*;
|
||||
import com.intellij.util.ui.EmptyIcon;
|
||||
import com.intellij.util.ui.GraphicsUtil;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -483,18 +484,17 @@ public class LookupCellRenderer implements ListCellRenderer {
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g){
|
||||
super.paint(g);
|
||||
if (!myLookup.isFocused() && myLookup.isCompletion()) {
|
||||
((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f));
|
||||
|
||||
// sub-pixel antialiasing does not work with alpha composite, so we workaround this by painting to RGB image first
|
||||
BufferedImage image = UIUtil.createImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
|
||||
Graphics2D imageGraphics = image.createGraphics();
|
||||
super.paint(imageGraphics);
|
||||
imageGraphics.dispose();
|
||||
UIUtil.drawImage(g, image, 0, 0, null);
|
||||
}
|
||||
else {
|
||||
super.paint(g);
|
||||
g = g.create();
|
||||
try {
|
||||
g.setColor(ColorUtil.withAlpha(BACKGROUND_COLOR, .4));
|
||||
Rectangle r = new Rectangle(getSize());
|
||||
g.fillRect(r.x, r.y, r.width, r.height);
|
||||
}
|
||||
finally {
|
||||
g.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user