From 8bab5abb8f480c104ab28cc97ad3fe751e99bbd6 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Wed, 22 Oct 2014 01:38:24 +0400 Subject: [PATCH] darcula: html viewer should have no visible background if background=null specified at creation time --- .../src/com/intellij/util/ui/SwingHelper.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java b/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java index 35719ca9366b..721e04469d24 100644 --- a/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java +++ b/platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java @@ -435,7 +435,15 @@ public class SwingHelper { textPane.setFont(font != null ? font : UIUtil.getLabelFont()); textPane.setContentType(UIUtil.HTML_MIME); textPane.setEditable(false); - textPane.setBackground(background != null ? background : UIUtil.getLabelBackground()); + if (background != null) { + textPane.setBackground(background); // e.g. UIUtil.getOptionPaneBackground() + } + else { + textPane.setOpaque(false); + if (UIUtil.isUnderNimbusLookAndFeel()) { + textPane.setBackground(UIUtil.TRANSPARENT_COLOR); + } + } textPane.setForeground(foreground != null ? foreground : UIUtil.getLabelForeground()); return textPane; }