Browse Source

Fixed fill painting. And resulting problems with TaskPane.

Signed-off-by: weisj <weisj@arcor.de>
pull/42/head
weisj 5 years ago
parent
commit
754ff3f93a
  1. 12
      core/src/main/java/com/github/weisj/darklaf/ui/taskpane/DarkTaskPaneUI.java

12
core/src/main/java/com/github/weisj/darklaf/ui/taskpane/DarkTaskPaneUI.java

@ -111,11 +111,11 @@ public class DarkTaskPaneUI extends MetalTaskPaneUI {
if (c.isOpaque()) {
g.setColor(c.getBackground());
g.setClip(clip.x, clip.x + h - arc, width, arc);
DarkUIUtil.fillRoundRect((Graphics2D) g, x, y, width - 1, h - 1, arc);
DarkUIUtil.fillRoundRect((Graphics2D) g, x - 1, y, width - 2, h - 1, arc);
}
g.setClip(clip.x, clip.y + h / 2 - 1, width, h / 2 + 2);
g.setColor(color);
DarkUIUtil.paintLineBorder((Graphics2D) g, x, y, width - 1, h - 1, arc);
DarkUIUtil.paintLineBorder((Graphics2D) g, x + 1, y, width - 2, h - 1, arc);
g.setClip(clip);
}
@ -141,19 +141,19 @@ public class DarkTaskPaneUI extends MetalTaskPaneUI {
g.setColor(titleBackgroundGradientStart);
}
if (isCollapsed()) {
DarkUIUtil.fillRoundRect(g, 0, 0, w - 1, h - 1, getRoundHeight());
DarkUIUtil.fillRoundRect(g, 1, 1, w - 2, h - 2, getRoundHeight());
g.setColor(borderColor);
DarkUIUtil.paintLineBorder(g, 0, 0, w - 1, h - 1, getRoundHeight());
DarkUIUtil.paintLineBorder(g, 1, 1, w - 2, h - 2, getRoundHeight());
} else {
Rectangle clip = g.getClip().getBounds();
g.setClip(0, 0, w, h / 2 + 1);
DarkUIUtil.fillRoundRect(g, 0, 0, w - 1, h - 1, getRoundHeight());
DarkUIUtil.fillRoundRect(g, 1, 1, w - 2, h - 2, getRoundHeight());
g.setClip(0, h / 2 - 1, w, h / 2 + 2);
g.fillRect(0, 0, w, h);
g.setColor(borderColor);
g.setClip(0, 0, w, h / 2 + 1);
DarkUIUtil.paintLineBorder(g, 0, 0, w - 1, h - 1, getRoundHeight());
DarkUIUtil.paintLineBorder(g, 1, 1, w - 2, h - 2, getRoundHeight());
g.setClip(0, h / 2 - 1, w, h / 2 + 2);
DarkUIUtil.drawRect(g, 0, 0, w, h, 1);
g.setClip(clip);

Loading…
Cancel
Save