From d32d2c0d57e423ed4307ddfed1a5f657fddeb86d Mon Sep 17 00:00:00 2001 From: vito Date: Mon, 6 May 2024 10:24:24 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-114888=20fix:=20=E6=A8=A1=E6=9D=BFtab?= =?UTF-8?q?=E6=A0=8F=E5=8F=B3=E9=94=AE=E5=BC=B9=E7=AA=97=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/MultiTemplateTabPane.java | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java index 10c0101877..ef9fb8fcc6 100644 --- a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java @@ -14,7 +14,6 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIScrollPopUpMenu; -import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -31,12 +30,10 @@ import com.fr.third.javax.annotation.Nonnull; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; -import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JOptionPane; import javax.swing.JSeparator; -import javax.swing.MenuElement; import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; import java.awt.AWTEvent; @@ -166,26 +163,15 @@ public class MultiTemplateTabPane extends Row { int tplIndex = getTemplateIndex(e.getX()); if (tplIndex > -1) { UIPopupMenu menu = new UIPopupMenu(); - menu.setBorder(BorderFactory.createEmptyBorder(-3, 3, 3, 0)); - for (CloseOption option : CloseOption.values()) { menu.add(new UIMenuItem(new RightMenuCloseAction(option, tplIndex))); } menu.add(new CloseMenuItemJSeparator()); menu.add(new UIMenuItem(new OpenInTemplateTreeAction(tplIndex))); - - int height = 0; - for (MenuElement subElement : menu.getSubElements()) { - if (subElement instanceof CloseMenuItemJSeparator) { - height += 10; - } else { - height += 25; - } - } - //根据当前i18n语言环境,动态调整popupMenu的宽度 - menu.setPreferredSize(new Dimension((int) DesignSizeI18nManager.getInstance(). - i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(), height)); - GUICoreUtils.showPopupMenu(menu, MultiTemplateTabPane.getInstance(), e.getX(), MultiTemplateTabPane.getInstance().getY() - 1 + MultiTemplateTabPane.getInstance().getHeight()); + GUICoreUtils.showPopupMenu(menu, + MultiTemplateTabPane.getInstance(), + e.getX(), + MultiTemplateTabPane.getInstance().getY() + MultiTemplateTabPane.getInstance().getHeight()); } } }