Browse Source

Don't decrease titlebar size if no border is painted.

pull/214/head
weisj 4 years ago
parent
commit
fd50bb8cd2
  1. 7
      windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java

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

Loading…
Cancel
Save