Browse Source

Don't paint titlebar border when it isn't opaque

titlebar_button_bounds
Jannis Weis 3 years ago
parent
commit
2a9efee3e5
No known key found for this signature in database
GPG Key ID: 7C9D8D4B558049AB
  1. 14
      macos/src/main/java/com/github/weisj/darklaf/platform/macos/ui/MacOSTitlePane.java
  2. 8
      windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java

14
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);

8
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();

Loading…
Cancel
Save