IDEA-135538 Editor tab name with blurring looks ugly on Ubuntu and Windows
authorVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Fri, 6 Mar 2015 20:41:34 +0000 (23:41 +0300)
committerVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Fri, 6 Mar 2015 20:43:49 +0000 (23:43 +0300)
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java
platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java
platform/platform-api/src/com/intellij/ui/tabs/impl/TabLabel.java

index e8b0fe9500d6c50285e83a10dbdc093dc07bced8..c5016e89aad43c28b9d740d1c1782c148e334a9b 100644 (file)
@@ -466,7 +466,7 @@ public class LookupCellRenderer implements ListCellRenderer {
     }
 
     @Override
-    protected void applyAdditionalHints(@NotNull Graphics g) {
+    protected void applyAdditionalHints(@NotNull Graphics2D g) {
       GraphicsUtil.setupAntialiasing(g);
     }
   }
index 0418f112cab2b5eac5ec179ad6cdce2e1d89ce47..7a676df610418779ab83343ec1e3ce28709bad00 100644 (file)
@@ -904,7 +904,7 @@ public class SimpleColoredComponent extends JComponent implements Accessible, Co
     icon.paintIcon(this, g, offset, (getHeight() - icon.getIconHeight()) / 2);
   }
 
-  protected void applyAdditionalHints(@NotNull Graphics g) {
+  protected void applyAdditionalHints(@NotNull Graphics2D g) {
   }
 
   @Override
index e55bc1ffb73fbc777aa80b3c3276354a3597a953..c1f49ae3e42ca7be8a82a8a1de681775bcee0f5a 100644 (file)
@@ -32,6 +32,7 @@ import com.intellij.ui.tabs.impl.table.TableLayout;
 import com.intellij.util.PairConsumer;
 import com.intellij.util.ui.Centerizer;
 import com.intellij.util.ui.UIUtil;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
@@ -152,6 +153,13 @@ public class TabLabel extends JPanel {
           g.setClip(oldClip);
         }
       }
+
+      @Override
+      protected void applyAdditionalHints(@NotNull Graphics2D g) {
+        if (!SystemInfo.isJavaVersionAtLeast("1.7") && g.getComposite() instanceof AlphaComposite && (((AlphaComposite)g.getComposite()).getAlpha() < 1)) {
+          g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
+        }
+      }
     };
     label.setOpaque(false);
     label.setBorder(null);