Skip to content

Commit 88cd0bb

Browse files
committed
Fix caret colour for Oceanic theme
1 parent 0b922fa commit 88cd0bb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/main/java/mdlaf/components/textfield/MaterialComponentField.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ protected void installMyDefaults(JComponent component) {
9696
textComponent.setSelectedTextColor(getComponent().hasFocus() && getComponent().isEnabled() ? activeForeground : inactiveForeground);
9797
textComponent.setForeground(getComponent().hasFocus() && getComponent().isEnabled() ? activeForeground : inactiveForeground);
9898
textComponent.setBorder(UIManager.getBorder(getPropertyPrefix() + ".border"));
99+
textComponent.setCaretColor(UIManager.getColor(getPropertyPrefix() + ".caretForeground"));
100+
99101
}
100102

101103
protected void logicForPropertyChange(Color newColor, boolean isForeground){

src/main/java/mdlaf/themes/MaterialOceanicTheme.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ public void installUIDefault(UIDefaults table) {
209209
table.put("TabbedPane[contentBorder].enableLeaf", false);
210210
table.put("TabbedPane[contentBorder].enableRight", false);
211211
table.put("TabbedPane[contentBorder].enableBottom", false);
212+
213+
table.put("TextField.caretForeground", Color.WHITE);
214+
table.put("TextArea.caretForeground", Color.WHITE);
215+
table.put("TextPane.caretForeground", Color.WHITE);
216+
table.put("PasswordField.caretForeground", Color.WHITE);
212217
}
213218

214219
@Override

0 commit comments

Comments
 (0)