diff --git a/macos/src/main/java/com/github/weisj/darklaf/platform/macos/ui/MacOSTitlePane.java b/macos/src/main/java/com/github/weisj/darklaf/platform/macos/ui/MacOSTitlePane.java index 46fd3276..bfdb364f 100644 --- a/macos/src/main/java/com/github/weisj/darklaf/platform/macos/ui/MacOSTitlePane.java +++ b/macos/src/main/java/com/github/weisj/darklaf/platform/macos/ui/MacOSTitlePane.java @@ -101,18 +101,18 @@ public class MacOSTitlePane extends CustomTitlePane { @Override public void paintComponent(final Graphics g) { + if (!isOpaque()) return; + int width = getWidth(); int height = getHeight(); - if (isOpaque()) { - Window window = getWindow(); - boolean active = window == null || window.isActive(); + Window window = getWindow(); + boolean active = window == null || window.isActive(); - Color background = active ? activeBackground : inactiveBackground; + Color background = active ? activeBackground : inactiveBackground; - g.setColor(background); - g.fillRect(0, 0, width, height); - } + g.setColor(background); + g.fillRect(0, 0, width, height); if (!hideTitleBar()) { g.setColor(border); diff --git a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java index fd08f526..7a91af8f 100644 --- a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java +++ b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java @@ -486,11 +486,11 @@ public class WindowsTitlePane extends CustomTitlePane { g.setColor(background); g.fillRect(0, 0, width, height); - } - if (isDrawBorder()) { - g.setColor(border); - g.fillRect(0, height - 1, width, 1); + if (isDrawBorder()) { + g.setColor(border); + g.fillRect(0, height - 1, width, 1); + } } GraphicsConfiguration currentGC = getGraphicsConfiguration();