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 b38b42cf..3103e4e9 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 @@ -529,7 +529,7 @@ public class WindowsTitlePane extends CustomTitlePane { g.setColor(background); g.fillRect(0, 0, width, height); - if (getDecorationStyle() != JRootPane.NONE && menuBar != null) { + if (isDrawBorder()) { g.setColor(border); g.fillRect(0, height - 1, width, 1); } @@ -542,6 +542,10 @@ public class WindowsTitlePane extends CustomTitlePane { } } + protected boolean isDrawBorder() { + return getDecorationStyle() != JRootPane.NONE && menuBar != null; + } + public JRootPane getRootPane() { return rootPane; } @@ -727,6 +731,7 @@ public class WindowsTitlePane extends CustomTitlePane { if (hideTitleBar()) return new Dimension(0, 0); int height = computeHeight(); int width = computeWidth(); + if (isDrawBorder()) height++; return new Dimension(width, height + 1); }