darcula: html viewer should have no visible background if background=null specified at creation time

This commit is contained in:
Sergey Simonchik
2014-10-22 01:38:24 +04:00
parent d98f743499
commit 8bab5abb8f
@@ -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;
}