Browse Source

combobox: editable combobox does not survive LaF change

fixes #104
pull/106/head
Vladimir Sitnikov 5 years ago
parent
commit
4030295ce5
  1. 1
      core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java
  2. 6
      core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextUI.java

1
core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java

@ -160,7 +160,6 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements Border, PropertyC
comboBox.repaint();
}
});
((JComponent) comp).setBorder(null);
return comboBoxEditor;
}

6
core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextUI.java

@ -91,6 +91,12 @@ public abstract class DarkTextUI extends BasicTextUI implements PropertyChangeLi
@Override
protected void installDefaults() {
super.installDefaults();
// OpenJDK BorderlessTextField has a bug with its setBorder implementation
// so we reset the border
// See https://mail.openjdk.java.net/pipermail/swing-dev/2020-March/010226.html
if (editor != null && "javax.swing.plaf.basic.BasicComboBoxEditor$BorderlessTextField".equals(editor.getClass().getName())) {
editor.setBorder(null);
}
editor.putClientProperty(KEY_ROUNDED_SELECTION, UIManager.getBoolean("TextComponent.roundedSelection"));
disabledColor = UIManager.getColor(getPropertyPrefix() + ".disabledBackground");
inactiveColor = UIManager.getColor(getPropertyPrefix() + ".inactiveBackground");

Loading…
Cancel
Save