fix mac popups bg color [finally]
authorAlexey Pegov <alexey.pegov@jetbrains.com>
Wed, 11 Aug 2010 13:58:15 +0000 (17:58 +0400)
committerAlexey Pegov <alexey.pegov@jetbrains.com>
Wed, 11 Aug 2010 13:58:15 +0000 (17:58 +0400)
platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java
platform/platform-impl/src/com/intellij/ui/popup/PopupComponent.java

index 5bfb2e92403cb2bd21efdc0a61aec265c62085b3..db179130e98b17ff91d3767ecc8b0d77dc97025f 100644 (file)
@@ -1025,10 +1025,6 @@ public class AbstractPopup implements JBPopup {
       else {
         setBorder(border);
       }
-
-      if (drawMacCorner && UIUtil.isUnderAquaLookAndFeel()) {
-        setBackground(new Color(UIUtil.getPanelBackgound().getRGB()));
-      }
     }
 
     public void paint(Graphics g) {
index 445c642a0e0a644ebd5a960256725c3f530f2974..94b4bbbdee29a27e169de410b739e4394fd18154 100644 (file)
@@ -17,7 +17,9 @@ package com.intellij.ui.popup;
 
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.ui.popup.util.PopupUtil;
+import com.intellij.openapi.util.SystemInfo;
 import com.intellij.util.ReflectionUtil;
+import com.intellij.util.ui.UIUtil;
 
 import javax.swing.*;
 import java.awt.*;
@@ -133,6 +135,11 @@ public interface PopupComponent {
 
     public AwtPopupWrapper(Popup popup) {
       myPopup = popup;
+
+      if (SystemInfo.isMac && UIUtil.isUnderAquaLookAndFeel()) {
+        final Component c = (Component)ReflectionUtil.getField(Popup.class, myPopup, Component.class, "component");
+        c.setBackground(UIUtil.getPanelBackgound());
+      }
     }
 
     public void hide(boolean dispose) {