Fix message box background for GTK+ L&F

This commit is contained in:
Roman Shevchenko
2011-10-06 19:31:52 +02:00
parent 7d95d41547
commit 4257131f8d
7 changed files with 19 additions and 46 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2010 JetBrains s.r.o.
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -407,7 +407,7 @@ public class ConfigurationErrorsComponent extends JPanel implements Disposable,
myFakeTextPane.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
myText.setOpaque(false);
if (UIUtil.isUnderNimbusLookAndFeel()) {
myText.setBackground(new Color(0, 0, 0, 0));
myText.setBackground(UIUtil.TRANSPARENT_COLOR);
}
myText.setEditable(false);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1013,9 +1013,9 @@ public class Messages {
messageComponent.setCaretPosition(0);
}
if (UIUtil.isUnderNimbusLookAndFeel()) {
if (UIUtil.isUnderNimbusLookAndFeel() || UIUtil.isUnderGTKLookAndFeel()) {
messageComponent.setOpaque(false);
messageComponent.setBackground(new Color(0, 0, 0, 0));
messageComponent.setBackground(UIUtil.TRANSPARENT_COLOR);
}
else {
messageComponent.setBackground(UIUtil.getOptionPaneBackground());
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,9 +21,6 @@ import javax.swing.*;
import java.awt.*;
public class NonOpaquePanel extends Wrapper {
private static final Color TRANSPARENT = new Color(0, 0, 0, 0);
public NonOpaquePanel() {
setOpaque(false);
}
@@ -59,7 +56,7 @@ public class NonOpaquePanel extends Wrapper {
if (!isOpaque && UIUtil.isUnderNimbusLookAndFeel()) {
if (UIUtil.isUnderNimbusLookAndFeel()) {
setBackground(TRANSPARENT);
setBackground(UIUtil.TRANSPARENT_COLOR);
}
}
}
@@ -67,7 +64,7 @@ public class NonOpaquePanel extends Wrapper {
public static void setTransparent(JComponent c) {
c.setOpaque(false);
if (UIUtil.isUnderNimbusLookAndFeel()) {
c.setBackground(TRANSPARENT);
c.setBackground(UIUtil.TRANSPARENT_COLOR);
}
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -241,7 +241,7 @@ public class NotificationsManagerImpl extends NotificationsManager implements No
text.setOpaque(false);
if (UIUtil.isUnderNimbusLookAndFeel()) {
text.setBackground(new Color(0, 0, 0, 0));
text.setBackground(UIUtil.TRANSPARENT_COLOR);
}
text.setBorder(null);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,7 +40,6 @@ public class IdeaActionButtonLook extends ActionButtonLook {
}
} else if (state == ActionButtonComponent.POPPED) {
((Graphics2D)g).setPaint(new GradientPaint(0, 0, new Color(235, 235, 235), 0, dimension.height, new Color(200, 200, 200)));
//g.setColor(new Color(190, 190, 190));
g.fillRect(1, 1, dimension.width - 3, dimension.height - 3);
}
}
@@ -55,26 +54,6 @@ public class IdeaActionButtonLook extends ActionButtonLook {
g.setColor(new Color(0, 0, 0, 30));
g.drawRect(1, 1, dimension.width - 3, dimension.height - 3);
/*
final Graphics2D g2d = (Graphics2D)g;
final int x = 1;
g2d.setPaint(new LinearGradientPaint(0, 0, 0, dimension.height, new float[] {0f, 0.5f, 1.0f},
new Color[] {new Color(0, 0, 0, 0), new Color(0, 0, 0, 40), new Color(0, 0, 0, 0)}));
g2d.fillRect(x, 0, dimension.width - 2, dimension.height);
g2d.setPaint(new LinearGradientPaint(0, 0, 0, dimension.height, new float[] {0f, 0.5f, 1.0f},
new Color[] {new Color(0, 0, 0, 40), new Color(0, 0, 0, 150), new Color(0, 0, 0, 40)}));
g2d.drawLine(x, 0, x, dimension.height);
g2d.drawLine(dimension.width - 2, 0, dimension.width - 2, dimension.height);
g2d.setPaint(new LinearGradientPaint(0, 0, 0, dimension.height, new float[] {0f, 0.5f, 1.0f},
new Color[] {new Color(0, 0, 0, 0), new Color(0, 0, 0, 60), new Color(0, 0, 0, 0)}));
g2d.drawLine(x + 1, 0, x + 1, dimension.height);
g2d.drawLine(dimension.width - 3, 0, dimension.width - 3, dimension.height);
*/
}
else {
g.setColor(new Color(130, 146, 185));
@@ -91,10 +70,6 @@ public class IdeaActionButtonLook extends ActionButtonLook {
if (state == ActionButtonComponent.POPPED) {
g.setColor(new Color(0, 0, 0, 30));
g.drawRoundRect(r.x, r.y, r.width - 2, r.height - 2, 4, 4);
//g.setColor(new Color(0, 0, 0, 30));
//g.drawLine(1, r.height - 2, r.width - 3, r.height - 2);
//g.drawLine(r.width - 2, 1, r.width - 2, r.height - 3);
}
} else {
Color color = new Color(8, 36, 107);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ import com.intellij.reference.SoftReference;
import com.intellij.util.ImageLoader;
import com.intellij.util.containers.ConcurrentHashMap;
import com.intellij.util.containers.WeakHashMap;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -35,7 +36,6 @@ import java.util.*;
public final class IconLoader {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.util.IconLoader");
private static final Color ourTransparentColor = new Color(0, 0, 0, 0);
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
private static final ConcurrentHashMap<URL, Icon> ourIconsCache = new ConcurrentHashMap<URL, Icon>(100, 0.9f,2);
@@ -190,7 +190,7 @@ public final class IconLoader {
final BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
final Graphics2D graphics = image.createGraphics();
graphics.setColor(ourTransparentColor);
graphics.setColor(UIUtil.TRANSPARENT_COLOR);
graphics.fillRect(0, 0, icon.getIconWidth(), icon.getIconHeight());
icon.paintIcon(ourFakeComponent, graphics, 0, 0);
@@ -94,11 +94,10 @@ public class UIUtil {
MacUIUtil.getInvertedTextCursor(): Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR);
}
public enum FontSize { NORMAL, TREE, SMALL, MINI }
public enum FontSize {NORMAL, TREE, SMALL, MINI}
public enum ComponentStyle {REGULAR, SMALL, MINI}
public enum FontColor {NORMAL, BRIGHTER}
public static final char MNEMONIC = 0x1B;
@NonNls public static final String HTML_MIME = "text/html";
@NonNls public static final String JSLIDER_ISFILLED = "JSlider.isFilled";
@@ -119,8 +118,10 @@ public class UIUtil {
private static final Color ACTIVE_HEADER_COLOR = new Color(160, 186, 213);
private static final Color INACTIVE_HEADER_COLOR = new Color(128, 128, 128);
private static final Color BORDER_COLOR = Color.LIGHT_GRAY;
public static Color AQUA_SEPARATOR_FOREGROUND_COLOR = new Color(190, 190, 190);
public static Color AQUA_SEPARATOR_BACKGROUND_COLOR = new Color(240, 240, 240);
public static final Color AQUA_SEPARATOR_FOREGROUND_COLOR = new Color(190, 190, 190);
public static final Color AQUA_SEPARATOR_BACKGROUND_COLOR = new Color(240, 240, 240);
public static final Color TRANSPARENT_COLOR = new Color(0, 0, 0, 0);
public static final int DEFAULT_HGAP = 10;
public static final int DEFAULT_VGAP = 5;