From 6d83456d3dc974edf639745b69a244f934acba9d Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Mon, 21 Nov 2022 19:50:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-84407=20=E8=AE=BE=E8=AE=A1=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF-=E5=8D=95=E5=85=83=E6=A0=BC=E5=85=83=E7=B4=A0?= =?UTF-8?q?=EF=BC=8C=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE=E7=A4=BA=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91UIlabel?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E8=A2=AB=E9=BB=98=E8=AE=A4=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?3=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91UIlab?= =?UTF-8?q?el=E9=AB=98=E5=BA=A6=E5=87=8F=E5=B0=913=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 67a65672f1..1793efa17d 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -67,6 +67,7 @@ public abstract class CellQuickEditor extends QuickEditor { private static final int CONTENT_PANE_WIDTH_GAP = 3; private static final int MOUSE_WHEEL_SPEED = 5; private static final int SCROLLBAR_WIDTH = 7; + private final int HTML_SHIFT_HEIGHT = -3; private UILabel cellLabel; private int maxHeight = 280; @@ -285,10 +286,11 @@ public abstract class CellQuickEditor extends QuickEditor { if (selectedOneCell) { columnRowTextField.setPreferredSize(null); cellLabel.setPreferredSize(null); - multipleLabelTip.setPreferredSize(new Dimension()); + // 使用UILabel.getPreferredSize时,若文本为html高度被默认增加3 + multipleLabelTip.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); } else { - columnRowTextField.setPreferredSize(new Dimension()); - cellLabel.setPreferredSize(new Dimension()); + columnRowTextField.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); + cellLabel.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); multipleLabelTip.setPreferredSize(null); } } From 947e420b837868876e34d549adda6a87cd15f0a3 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 22 Nov 2022 13:36:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-84407=20=E4=BF=AE=E6=94=B9=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E9=9D=A2=E6=9D=BF=E6=97=B6=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E3=80=81=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/quickeditor/CellQuickEditor.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 1793efa17d..0b0650478b 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -58,6 +58,9 @@ import java.util.Set; public abstract class CellQuickEditor extends QuickEditor { protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20); + + // 使用UILabel.getPreferredSize时,若文本为html高度被默认增加3 + protected static final Dimension HIDDEN_LABEL_DIMENSION = new Dimension(0, -3); protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; /** @@ -67,7 +70,6 @@ public abstract class CellQuickEditor extends QuickEditor { private static final int CONTENT_PANE_WIDTH_GAP = 3; private static final int MOUSE_WHEEL_SPEED = 5; private static final int SCROLLBAR_WIDTH = 7; - private final int HTML_SHIFT_HEIGHT = -3; private UILabel cellLabel; private int maxHeight = 280; @@ -286,11 +288,10 @@ public abstract class CellQuickEditor extends QuickEditor { if (selectedOneCell) { columnRowTextField.setPreferredSize(null); cellLabel.setPreferredSize(null); - // 使用UILabel.getPreferredSize时,若文本为html高度被默认增加3 - multipleLabelTip.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); + multipleLabelTip.setPreferredSize(HIDDEN_LABEL_DIMENSION); } else { - columnRowTextField.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); - cellLabel.setPreferredSize(new Dimension(0, HTML_SHIFT_HEIGHT)); + columnRowTextField.setPreferredSize(HIDDEN_LABEL_DIMENSION); + cellLabel.setPreferredSize(HIDDEN_LABEL_DIMENSION); multipleLabelTip.setPreferredSize(null); } }