From 09284a661f1be8811b6839c043bc9db96dff27d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 3 Sep 2024 17:06:56 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-133198=20fix:List=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/controlpane/JListControlPane.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 828d9f845f..7a1094ab17 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -374,10 +374,8 @@ public abstract class JListControlPane extends JControlPane implements ListContr this.iconLabel.setBorder(new ScaledEmptyBorder(0, 4, 0, 0)); add(this.textLabel, BorderLayout.CENTER); add(this.iconLabel, BorderLayout.WEST); - this.iconLabel.setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); - //iconLabel和textLabel的背景颜色不会被JList背景颜色覆盖,开发者自定义 - this.textLabel.setOpaque(true); - this.iconLabel.setOpaque(true); + this.textLabel.setOpaque(false); + this.iconLabel.setOpaque(false); } @Override @@ -390,9 +388,9 @@ public abstract class JListControlPane extends JControlPane implements ListContr this.textLabel.setText(nameable.getName()); boolean iconSet = false; if(isSelected) { - this.textLabel.setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY)); + setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY)); } else { - this.textLabel.setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); + setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); } for (NameableCreator creator : JListControlPane.this.creators()) { if (creator.menuIcon() != null && creator.acceptObject2Populate(nameable) != null) {