Browse Source

REPORT-111995 【UI翻新】优化东区显示效果

newui
Levy.Xie-解安森 11 months ago
parent
commit
e76877cb0f
  1. 8
      designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java

8
designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java

@ -27,6 +27,7 @@ public class HeaderPane extends JPanel {
private int fontSize;
private final Icon triangleDown;
private final Icon triangleRight;
private static final int ICON_FIX = -2;
public void setPressed(boolean pressed) {
this.isPressed = pressed;
@ -56,10 +57,11 @@ public class HeaderPane extends JPanel {
g2d.fillRect(0, insets.top / 2, this.getWidth(), this.getHeight() - (insets.top + insets.bottom) / 2);
int iconY = (this.getHeight() - triangleDown.getIconHeight()) / 2;
// 折叠面板需要icon显示左边缘对齐,fix一下
if (this.isShow) {
triangleDown.paintIcon(this, g2d, 0, iconY);
triangleDown.paintIcon(this, g2d, FineUIScale.scale(ICON_FIX), iconY);
} else {
triangleRight.paintIcon(this, g2d, 0, iconY);
triangleRight.paintIcon(this, g2d, FineUIScale.scale(ICON_FIX), iconY);
}
g2d.setFont(getFont());
@ -70,7 +72,7 @@ public class HeaderPane extends JPanel {
int ascent = metrics.getAscent();
int descent = metrics.getDescent();
float titleX = triangleDown.getIconWidth()
float titleX = triangleDown.getIconWidth() + FineUIScale.scale(ICON_FIX)
+ FineUIScale.scale(UIManager.getInt("ExpandablePane.HeaderPane.hGap"));
float titleY = (getHeight() - (ascent + descent)) / 2.0f + ascent;
FlatUIUtils.setRenderingHints(g2d);

Loading…
Cancel
Save