From fb3a33186e4895428fcdc6e513c03b84830dd4f4 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Thu, 3 Jun 2021 17:10:56 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-53019=20=E5=AD=97=E4=BD=93=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/check/CheckButton.java | 17 ++++++++++++++- .../mainframe/check/CheckFontInfoDialog.java | 21 +++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java index e55f9a481..b2fc99359 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java @@ -10,6 +10,7 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; +import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; import com.fr.rpc.ExceptionHandler; import com.fr.rpc.RPCInvokerExceptionInfo; @@ -27,6 +28,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.util.Locale; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -194,7 +196,7 @@ public class CheckButton extends UIButton { dialog = new JDialog(); dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font")); dialog.setModal(true); - dialog.setSize(new Dimension(268, 118)); + dialog.setSize(new Dimension(getDialogWidth(), 118)); JPanel jp = new JPanel(); JPanel upPane = new JPanel(); JPanel downPane = new JPanel(); @@ -211,4 +213,17 @@ public class CheckButton extends UIButton { dialog.setResizable(false); dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this)); } + + private int getDialogWidth() { + Locale locale = GeneralContext.getLocale(); + if (locale.equals(Locale.US)) { + return 305; + } else if (locale.equals(Locale.JAPAN)) { + return 280; + } else if (locale.equals(Locale.KOREA)) { + return 230; + } else { + return 250; + } + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java index 0d5771a49..752bf12a5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java @@ -52,7 +52,7 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener { MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"), Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"), CloudCenter.getInstance().acquireUrlByKind("help.install.font", "https://help.fanruan.com/finereport/doc-view-3999.html")); - linkMessage.setPreferredSize(new Dimension(380, 31)); + linkMessage.setPreferredSize(new Dimension(getPaneWidth(), 31)); messagePanel.add(linkMessage); // 查看详情按钮 @@ -89,11 +89,11 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener { public void mouseClicked(MouseEvent e) { if (hiddenPanel.isVisible()) { hiddenPanel.setVisible(false); - CheckFontInfoDialog.this.setSize(new Dimension(380, 185)); + CheckFontInfoDialog.this.setSize(new Dimension(getPaneWidth(), 185)); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right")); } else { - CheckFontInfoDialog.this.setSize(new Dimension(380, 280)); + CheckFontInfoDialog.this.setSize(new Dimension(getPaneWidth(), 280)); hiddenPanel.setVisible(true); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail")); directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down")); @@ -114,11 +114,24 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener { this.add(topPanel, BorderLayout.NORTH); this.add(hiddenPanel, BorderLayout.CENTER); this.add(bottomPanel, BorderLayout.SOUTH); - this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 400:380, 185)); + this.setSize(new Dimension(getPaneWidth(), 185)); GUICoreUtils.centerWindow(this); } + private int getPaneWidth() { + Locale locale = GeneralContext.getLocale(); + if (locale.equals(Locale.US)) { + return 630; + } else if (locale.equals(Locale.JAPAN)) { + return 610; + } else if (locale.equals(Locale.KOREA)) { + return 490; + } else { + return 385; + } + } + @Override public void actionPerformed(ActionEvent e) { this.dispose();