Browse Source

REPORT-133198 fix:List面板背景逻辑调整

fbp/release
Levy.Xie-解安森 3 months ago
parent
commit
09284a661f
  1. 10
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

10
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)); this.iconLabel.setBorder(new ScaledEmptyBorder(0, 4, 0, 0));
add(this.textLabel, BorderLayout.CENTER); add(this.textLabel, BorderLayout.CENTER);
add(this.iconLabel, BorderLayout.WEST); add(this.iconLabel, BorderLayout.WEST);
this.iconLabel.setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); this.textLabel.setOpaque(false);
//iconLabel和textLabel的背景颜色不会被JList背景颜色覆盖,开发者自定义 this.iconLabel.setOpaque(false);
this.textLabel.setOpaque(true);
this.iconLabel.setOpaque(true);
} }
@Override @Override
@ -390,9 +388,9 @@ public abstract class JListControlPane extends JControlPane implements ListContr
this.textLabel.setText(nameable.getName()); this.textLabel.setText(nameable.getName());
boolean iconSet = false; boolean iconSet = false;
if(isSelected) { if(isSelected) {
this.textLabel.setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY)); setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY));
} else { } 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()) { for (NameableCreator creator : JListControlPane.this.creators()) {
if (creator.menuIcon() != null && creator.acceptObject2Populate(nameable) != null) { if (creator.menuIcon() != null && creator.acceptObject2Populate(nameable) != null) {

Loading…
Cancel
Save