From 08068d56e7dca2791daa3960f9e297f82f8c3307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Thu, 24 Oct 2024 14:57:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-138579=20fix:=20ComboBox=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E9=87=8D=E5=A4=8D=E7=BC=A9=E6=94=BE=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/tabledatapane/MaxMemRowCountPanel.java | 4 +++- .../src/main/java/com/fr/design/gui/icombobox/UIComboBox.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index d3e43724a9..9fa9a85738 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -17,6 +17,7 @@ import com.fr.stable.StringUtils; import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX; import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE; +import static com.fine.theme.utils.FineUIScale.scale; public class MaxMemRowCountPanel extends UIToolbar { @@ -24,7 +25,7 @@ public class MaxMemRowCountPanel extends UIToolbar { private static final int MAX_IN_MEMORY = 1; private static final String[] CACHE_LIST = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") }; - private static final int MAX_WIDTH = getMaxComBoBoxWidth() > 200 ? 350 : 280; + private static final int MAX_WIDTH = getMaxComBoBoxWidth(); private static final int MAX_COMPONENT_COUNT_OF_MAX_MEMORY = 4; private static int getMaxComBoBoxWidth() { int maxWidth = GraphHelper.getWidth(CACHE_LIST[0]); @@ -34,6 +35,7 @@ public class MaxMemRowCountPanel extends UIToolbar { maxWidth = width; } } + maxWidth = maxWidth > scale(200) ? scale(350) : scale(280); return maxWidth; } diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java index 27dea24e21..6b3903ee5a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java @@ -162,7 +162,7 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser int renderFix = FineUIScale.scale(5); int comboHeight = FineUIUtils.getAndScaleInt("ComboBox.comboHeight", 24); //renderFix的原因在于:render里,每一个项前面了空了一格,要多几像素 - return new Dimension(FineUIScale.scale(super.getPreferredSize().width) + renderFix, comboHeight); + return new Dimension(super.getPreferredSize().width + renderFix, comboHeight); } public void refreshBoxItems(List list) { From 15d8625836eaef2aa8b64903a26ecd71d54a0638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Thu, 24 Oct 2024 14:59:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-138579=20fix:=20ComboBox=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E9=87=8D=E5=A4=8D=E7=BC=A9=E6=94=BE=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/tabledatapane/MaxMemRowCountPanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index 9fa9a85738..3d2ee413e4 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -25,9 +25,9 @@ public class MaxMemRowCountPanel extends UIToolbar { private static final int MAX_IN_MEMORY = 1; private static final String[] CACHE_LIST = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") }; - private static final int MAX_WIDTH = getMaxComBoBoxWidth(); + private static final int MAX_WIDTH = getMaxWidth(); private static final int MAX_COMPONENT_COUNT_OF_MAX_MEMORY = 4; - private static int getMaxComBoBoxWidth() { + private static int getMaxWidth() { int maxWidth = GraphHelper.getWidth(CACHE_LIST[0]); for (int i = 1; i < CACHE_LIST.length; i++) { int width = GraphHelper.getWidth(CACHE_LIST[i]);