Browse Source

Pull request #11972: REPORT-92161 反色问题,把选中变色的逻辑提出,和setIcon分开

Merge in DESIGN/design from ~OBO/design:release/11.0 to release/11.0

* commit 'dcdbd2ac61b22ebae997972f4bf9c0e2b906d291':
  REPORT-92161 反色问题,把选中变色的逻辑提出,和setIcon分开
  REPORT-92161 反色问题,把选中变色的逻辑提出,和setIcon分开
release/11.0
Obo-王学仁 1 year ago
parent
commit
fef7e1b789
  1. 14
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

14
designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

@ -376,16 +376,16 @@ public abstract class JListControlPane extends JControlPane implements ListContr
Nameable nameable = element.wrapper;
this.textLabel.setText(nameable.getName());
boolean iconSet = false;
if(isSelected) {
this.textLabel.setBackground(selectedBgColor);
this.textLabel.setForeground(Color.WHITE);
} else {
this.textLabel.setBackground(Color.WHITE);
this.textLabel.setForeground(Color.BLACK);
}
for (NameableCreator creator : JListControlPane.this.creators()) {
if (creator.menuIcon() != null && creator.acceptObject2Populate(nameable) != null) {
this.iconLabel.setIcon(creator.menuIcon());
if(isSelected) {
this.textLabel.setBackground(selectedBgColor);
this.textLabel.setForeground(Color.WHITE);
} else {
this.textLabel.setBackground(Color.WHITE);
this.textLabel.setForeground(Color.BLACK);
}
this.setToolTipText(creator.createTooltip());
iconSet = true;
break;

Loading…
Cancel
Save