Browse Source

Pull request #13500: REPORT-99485 模版tab组件windows下文字抗锯齿

Merge in DESIGN/design from ~VITO/c-design:newui to newui

* commit '48f6ba7af1132abc715f7113515f88e9778f7258':
  REPORT-99485 模版tab组件windows下文字抗锯齿
newui
vito-刘恒霖 12 months ago
parent
commit
8796a10a31
  1. 21
      designer-base/src/main/java/com/fine/theme/light/ui/FineTemplateTabPaneUI.java

21
designer-base/src/main/java/com/fine/theme/light/ui/FineTemplateTabPaneUI.java

@ -305,14 +305,18 @@ public class FineTemplateTabPaneUI extends PanelUI {
g2d.setPaint(borderColor); g2d.setPaint(borderColor);
paintRoundTabBorder(g2d, templateStartX, 0, paintRoundTabBorder(g2d, templateStartX, 0,
tabPane.getTabWidth(), tabHeight, borderWidth, (float) tabArc); tabPane.getTabWidth(), tabHeight, borderWidth, (float) tabArc);
FlatUIUtils.resetRenderingHints(g2d, oriRenderingHints);
// 绘制图标
int sheetIconY = (tabHeight - sheeticon.getIconHeight()) / 2;
sheeticon.paintIcon(tabPane, g2d, (int) templateStartX + tabInsets.left, sheetIconY);
// 绘制字符 // 绘制字符
g2d.setPaint(tabPane.getForeground()); g2d.setPaint(tabPane.getForeground());
Point2D.Double textPoint = calTextPoint(templateStartX, sheeticon.getIconWidth()); Point2D.Double textPoint = calTextPoint(templateStartX, sheeticon.getIconWidth());
g2d.drawString(sheetName, (int) textPoint.x, (int) textPoint.y); g2d.drawString(sheetName, (int) textPoint.x, (int) textPoint.y);
FlatUIUtils.resetRenderingHints(g2d, oriRenderingHints);
// 绘制图标
int sheetIconY = (tabHeight - sheeticon.getIconHeight()) / 2;
sheeticon.paintIcon(tabPane, g2d, (int) templateStartX + tabInsets.left, sheetIconY);
int closePosition = (int) templateStartX + tabPane.getTabWidth() int closePosition = (int) templateStartX + tabPane.getTabWidth()
- this.closeIcon.getIconWidth() - tabInsets.right; - this.closeIcon.getIconWidth() - tabInsets.right;
int closeY = (tabHeight - closeIcon.getIconHeight()) / 2; int closeY = (tabHeight - closeIcon.getIconHeight()) / 2;
@ -352,15 +356,16 @@ public class FineTemplateTabPaneUI extends PanelUI {
tabPane.getTabWidth(), tabHeight - scale(borderWidth), tabArc); tabPane.getTabWidth(), tabHeight - scale(borderWidth), tabArc);
g2d.fill(tabShape); g2d.fill(tabShape);
// 画字符
g2d.setPaint(tabPane.getForeground());
Point2D.Double textPoint = calTextPoint(templateStartX, sheeticon.getIconWidth());
g2d.drawString(sheetName, (int) textPoint.x, (int) textPoint.y);
FlatUIUtils.resetRenderingHints(g2d, oriRenderingHints); FlatUIUtils.resetRenderingHints(g2d, oriRenderingHints);
// 画图标
int sheetIconY = (tabHeight - sheeticon.getIconHeight()) / 2; int sheetIconY = (tabHeight - sheeticon.getIconHeight()) / 2;
sheeticon.paintIcon(tabPane, g2d, (int) templateStartX + tabInsets.left, sheetIconY); sheeticon.paintIcon(tabPane, g2d, (int) templateStartX + tabInsets.left, sheetIconY);
// 画字符
g2d.setPaint(tabPane.getForeground());
Point2D.Double textPoint = calTextPoint(templateStartX, sheeticon.getIconWidth());
g2d.drawString(sheetName, (int) textPoint.x, (int) textPoint.y);
int closeY = (tabHeight - closeIcon.getIconHeight()) / 2; int closeY = (tabHeight - closeIcon.getIconHeight()) / 2;
int closePosition = (int) templateStartX + tabPane.getTabWidth() int closePosition = (int) templateStartX + tabPane.getTabWidth()
- this.closeIcon.getIconWidth() - tabInsets.right; - this.closeIcon.getIconWidth() - tabInsets.right;

Loading…
Cancel
Save