From de8cf02d68f0c97941e9fe532e8e3ceae45e8824 Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 30 Jul 2024 18:19:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5-=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperlink/popup/ContentSettingPane.java | 8 +++-- .../hyperlink/popup/MobilePopupUIUtils.java | 9 +++--- .../hyperlink/popup/StyleSettingPane.java | 4 ++- .../mainframe/widget/UITitleSplitLine.java | 29 ++++++++++++++----- 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java index 848ac9e57c..bd7bf3b548 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java @@ -3,6 +3,7 @@ package com.fr.design.hyperlink.popup; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; import com.fr.base.Parameter; +import com.fr.base.i18n.BidiUtils; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.formula.TinyFormulaPane; @@ -73,6 +74,7 @@ public class ContentSettingPane extends AbstractHyperLinkPane { this.add(typePane, BorderLayout.NORTH); stylePane = this.createStylePane(); this.add(stylePane, BorderLayout.CENTER); + BidiUtils.applyOrientationByLocale(this); } private JPanel createTypePane() { JPanel typePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); popupTypeLabel = new UILabel(""); - typePane.add(popupTypeLabel, BorderLayout.CENTER); + typePane.add(popupTypeLabel, BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.CENTER); return MobilePopupUIUtils.createLeftTileRightContentPanel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Type"), typePane); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java index f7e2779a4e..c2e5b5728f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java @@ -1,7 +1,9 @@ package com.fr.design.mainframe.widget; +import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.ilable.UILabel; import com.fr.general.FRFont; + import javax.swing.JPanel; import java.awt.Color; import java.awt.Dimension; @@ -35,14 +37,25 @@ public class UITitleSplitLine extends JPanel { Dimension size = label.getPreferredSize(); int labelH = size.height; g.setColor(color); - g.drawLine(0, labelH / 2, OFFSETX, labelH / 2); - g.drawLine(OFFSETX + size.width + OFFSET * 2, labelH / 2, width, labelH / 2); - g.translate(OFFSETX + OFFSET, 0); - label.setFont(TITLE_FONT); - label.setForeground(TITLE_COLOR); - label.setSize(size.width, size.height); - label.paint(g); - g.translate(-OFFSETX - OFFSET, 0); + if (BidiUtils.rtl()) { + g.drawLine(0, labelH / 2, width - OFFSETX - size.width - OFFSET * 2, labelH / 2); + g.drawLine(width - OFFSETX, labelH / 2, width, labelH / 2); + g.translate(width - OFFSETX - size.width - OFFSET, 0); + label.setFont(TITLE_FONT); + label.setForeground(TITLE_COLOR); + label.setSize(size.width, size.height); + label.paint(g); + g.translate(-width + OFFSETX + size.width + OFFSET, 0); + } else { + g.drawLine(0, labelH / 2, OFFSETX, labelH / 2); + g.drawLine(OFFSETX + size.width + OFFSET * 2, labelH / 2, width, labelH / 2); + g.translate(OFFSETX + OFFSET, 0); + label.setFont(TITLE_FONT); + label.setForeground(TITLE_COLOR); + label.setSize(size.width, size.height); + label.paint(g); + g.translate(-OFFSETX - OFFSET, 0); + } }