Browse Source

Reduce issue of non-available subpixel AA on windows for plain tooltips.

pull/188/head
weisj 5 years ago
parent
commit
65f7763085
  1. 15
      core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkToolTipUI.java

15
core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkToolTipUI.java

@ -178,8 +178,19 @@ public class DarkToolTipUI extends BasicToolTipUI implements PropertyChangeListe
startAnimation();
} else {
Window window = DarkUIUtil.getWindow(c);
if (window != null && window.getOpacity() != 1 && !transparencySupported(window)) {
window.setOpacity(1);
if (window != null) {
if (window.getOpacity() != 1 && !transparencySupported(window)) {
window.setOpacity(1);
}
/*
* In non opaque windows on Windows subpixel AA doesn't work. The translucent background isn't needed
* for the plain tooltip style, so we set it here.
*
* See https://bugs.openjdk.java.net/browse/JDK-8215980?attachmentOrder=desc
*/
if (style == ToolTipStyle.PLAIN) {
window.setBackground(c.getBackground());
}
}
}
GraphicsContext context = GraphicsUtil.setupAntialiasing(g);

Loading…
Cancel
Save