Browse Source

Merge pull request #106 from vlsi/combobox_borders

combobox: editable combobox does not survive LaF change
Fixes #104
pull/127/head
Jannis Weis 5 years ago committed by GitHub
parent
commit
2878953309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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

@ -162,7 +162,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