From 48f6ba7af1132abc715f7113515f88e9778f7258 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 10 Jan 2024 11:01:40 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-99485=20=E6=A8=A1=E7=89=88tab=E7=BB=84?= =?UTF-8?q?=E4=BB=B6windows=E4=B8=8B=E6=96=87=E5=AD=97=E6=8A=97=E9=94=AF?= =?UTF-8?q?=E9=BD=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/light/ui/FineTemplateTabPaneUI.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineTemplateTabPaneUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineTemplateTabPaneUI.java index 2de24c89c..a1ecd9a5a 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineTemplateTabPaneUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineTemplateTabPaneUI.java @@ -305,14 +305,18 @@ public class FineTemplateTabPaneUI extends PanelUI { g2d.setPaint(borderColor); paintRoundTabBorder(g2d, templateStartX, 0, 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()); Point2D.Double textPoint = calTextPoint(templateStartX, sheeticon.getIconWidth()); 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() - this.closeIcon.getIconWidth() - tabInsets.right; int closeY = (tabHeight - closeIcon.getIconHeight()) / 2; @@ -352,15 +356,16 @@ public class FineTemplateTabPaneUI extends PanelUI { tabPane.getTabWidth(), tabHeight - scale(borderWidth), tabArc); 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); + // 画图标 int sheetIconY = (tabHeight - sheeticon.getIconHeight()) / 2; 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 closePosition = (int) templateStartX + tabPane.getTabWidth() - this.closeIcon.getIconWidth() - tabInsets.right;