Browse Source

Add icon for JColorChooser.

Decrease size of hexvalue field for SmallColorChooser.
Move textfield padding from border to margins.
pull/214/head
weisj 4 years ago
parent
commit
988a0dfc65
  1. 19
      core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java
  2. 6
      core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserUI.java
  3. 2
      core/src/main/java/com/github/weisj/darklaf/ui/text/DarkPasswordFieldUI.java
  4. 7
      core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextBorder.java
  5. 50
      core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextFieldUI.java
  6. 14
      core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextUI.java
  7. 25
      core/src/main/resources/com/github/weisj/darklaf/icons/menu/colorChooser.svg
  8. 1
      core/src/main/resources/com/github/weisj/darklaf/properties/icons/menu.properties
  9. 4
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/button.properties
  10. 1
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/colorChooser.properties
  11. 18
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/text.properties
  12. 2
      property-loader/src/main/java/com/github/weisj/darklaf/PropertyLoader.java

19
core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java

@ -27,6 +27,7 @@ import java.util.Map;
import java.util.function.Consumer; import java.util.function.Consumer;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border;
import com.github.weisj.darklaf.color.DarkColorModel; import com.github.weisj.darklaf.color.DarkColorModel;
import com.github.weisj.darklaf.color.DarkColorModelHSB; import com.github.weisj.darklaf.color.DarkColorModelHSB;
@ -34,6 +35,7 @@ import com.github.weisj.darklaf.color.DarkColorModelHSL;
import com.github.weisj.darklaf.color.DarkColorModelRGB; import com.github.weisj.darklaf.color.DarkColorModelRGB;
import com.github.weisj.darklaf.components.DefaultColorPipette; import com.github.weisj.darklaf.components.DefaultColorPipette;
import com.github.weisj.darklaf.components.border.DarkBorders; import com.github.weisj.darklaf.components.border.DarkBorders;
import com.github.weisj.darklaf.components.border.MarginBorderWrapper;
import com.github.weisj.darklaf.graphics.GraphicsUtil; import com.github.weisj.darklaf.graphics.GraphicsUtil;
import com.github.weisj.darklaf.listener.UpdateDocumentListener; import com.github.weisj.darklaf.listener.UpdateDocumentListener;
import com.github.weisj.darklaf.ui.button.DarkButtonUI; import com.github.weisj.darklaf.ui.button.DarkButtonUI;
@ -167,7 +169,8 @@ public class SmallColorChooser extends JPanel {
JPanel hexFieldHolder = new JPanel(new GridBagLayout()); JPanel hexFieldHolder = new JPanel(new GridBagLayout());
hexFieldHolder.setOpaque(false); hexFieldHolder.setOpaque(false);
Box hexBox = Box.createHorizontalBox(); Box hexBox = Box.createHorizontalBox();
hexBox.add(new JLabel("#")); JLabel label = new JLabel("#");
hexBox.add(label);
hexBox.add(createHexField()); hexBox.add(createHexField());
hexFieldHolder.add(hexBox); hexFieldHolder.add(hexBox);
@ -206,6 +209,7 @@ public class SmallColorChooser extends JPanel {
protected JComponent createHexField() { protected JComponent createHexField() {
hexField = new JFormattedTextField(); hexField = new JFormattedTextField();
hexField.setColumns(6); hexField.setColumns(6);
hexField.setMargin(new Insets(2, 2, 2, 2));
hexField.setFocusLostBehavior(JFormattedTextField.COMMIT_OR_REVERT); hexField.setFocusLostBehavior(JFormattedTextField.COMMIT_OR_REVERT);
hexFormatter = ColorValueFormatter.init(null, 0, true, hexField); hexFormatter = ColorValueFormatter.init(null, 0, true, hexField);
hexFormatter.setModel(getDarkColorModel()); hexFormatter.setModel(getDarkColorModel());
@ -296,13 +300,16 @@ public class SmallColorChooser extends JPanel {
return getPreferredSize(); return getPreferredSize();
} }
@SuppressWarnings("SuspiciousNameCombination")
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension size = hexField.getPreferredSize(); Dimension dim = hexField.getPreferredSize();
size.width = size.height - 2 * UIManager.getInt("TextField.borderThickness"); Border border = MarginBorderWrapper.getBorder(hexField);
size.height = size.width; Insets ins = border != null ? border.getBorderInsets(hexField) : null;
return size; int size = dim.height;
if (ins != null) size -= ins.top + ins.bottom;
dim.width = size;
dim.height = size;
return dim;
} }
}; };
} }

6
core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserUI.java

@ -23,6 +23,7 @@ package com.github.weisj.darklaf.ui.colorchooser;
import java.awt.*; import java.awt.*;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.util.List;
import javax.swing.*; import javax.swing.*;
import javax.swing.colorchooser.AbstractColorChooserPanel; import javax.swing.colorchooser.AbstractColorChooserPanel;
@ -35,6 +36,7 @@ import com.github.weisj.darklaf.color.DarkColorModelCMYK;
import com.github.weisj.darklaf.color.DarkColorModelHSB; import com.github.weisj.darklaf.color.DarkColorModelHSB;
import com.github.weisj.darklaf.color.DarkColorModelHSL; import com.github.weisj.darklaf.color.DarkColorModelHSL;
import com.github.weisj.darklaf.color.DarkColorModelRGB; import com.github.weisj.darklaf.color.DarkColorModelRGB;
import com.github.weisj.darklaf.icons.IconLoader;
import com.github.weisj.darklaf.listener.AncestorAdapter; import com.github.weisj.darklaf.listener.AncestorAdapter;
import com.github.weisj.darklaf.util.PropertyKey; import com.github.weisj.darklaf.util.PropertyKey;
@ -67,6 +69,10 @@ public class DarkColorChooserUI extends BasicColorChooserUI {
((Dialog) win).setResizable(false); ((Dialog) win).setResizable(false);
chooser.removeAncestorListener(ancestorListener); chooser.removeAncestorListener(ancestorListener);
} }
List<Image> imageList = win.getIconImages();
if (imageList == null || imageList.isEmpty()) {
win.setIconImage(IconLoader.createFrameIcon(UIManager.getIcon("ColorChooser.icon"), win));
}
} }
}; };

2
core/src/main/java/com/github/weisj/darklaf/ui/text/DarkPasswordFieldUI.java

@ -90,7 +90,7 @@ public class DarkPasswordFieldUI extends DarkPasswordFieldUIBridge {
} }
private boolean isOverEye(final Point p) { private boolean isOverEye(final Point p) {
return !passwordEmpty() && DarkTextFieldUI.isOver(getRightIconCoord(), getShowIcon(editor), p); return !passwordEmpty() && DarkTextFieldUI.isOver(getRightIconPos(), getShowIcon(editor), p);
} }
protected boolean passwordEmpty() { protected boolean passwordEmpty() {

7
core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextBorder.java

@ -25,6 +25,7 @@ import java.awt.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.plaf.InsetsUIResource;
import javax.swing.plaf.UIResource; import javax.swing.plaf.UIResource;
import javax.swing.text.JTextComponent; import javax.swing.text.JTextComponent;
@ -47,8 +48,6 @@ public class DarkTextBorder implements Border, UIResource {
protected final Color inactiveBorderColor; protected final Color inactiveBorderColor;
protected final Color inactiveFocusBorderColor; protected final Color inactiveFocusBorderColor;
protected Insets padding;
protected final int borderSize; protected final int borderSize;
protected final int arc; protected final int arc;
protected final int searchArc; protected final int searchArc;
@ -69,8 +68,6 @@ public class DarkTextBorder implements Border, UIResource {
focusArc = UIManager.getInt("TextField.focusArc"); focusArc = UIManager.getInt("TextField.focusArc");
searchArc = UIManager.getInt("TextField.searchArc"); searchArc = UIManager.getInt("TextField.searchArc");
searchFocusArc = UIManager.getInt("TextField.searchFocusArc"); searchFocusArc = UIManager.getInt("TextField.searchFocusArc");
padding = UIManager.getInsets("TextField.insets");
if (padding == null) padding = new Insets(0, 0, 0, 0);
} }
protected static boolean hasError(final Component c) { protected static boolean hasError(final Component c) {
@ -147,7 +144,7 @@ public class DarkTextBorder implements Border, UIResource {
@Override @Override
public Insets getBorderInsets(final Component c) { public Insets getBorderInsets(final Component c) {
return DarkUIUtil.addInsets(new Insets(borderSize, borderSize, borderSize, borderSize), padding); return new InsetsUIResource(borderSize, borderSize, borderSize, borderSize);
} }
@Override @Override

50
core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextFieldUI.java

@ -63,7 +63,7 @@ public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyCh
protected Color inactiveBackground; protected Color inactiveBackground;
private long lastSearchEvent; private long lastSearchEvent;
protected Insets padding; private int buttonPad;
private final PopupMenuListener searchPopupListener = new PopupMenuAdapter() { private final PopupMenuListener searchPopupListener = new PopupMenuAdapter() {
@Override @Override
@ -118,9 +118,8 @@ public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyCh
protected Dimension addIconSizes(final Dimension dim) { protected Dimension addIconSizes(final Dimension dim) {
JTextComponent comp = getComponent(); JTextComponent comp = getComponent();
boolean ltr = comp.getComponentOrientation().isLeftToRight(); int leftPad = buttonPad;
int leftPad = ltr ? padding.left : padding.right; int rightPad = buttonPad;
int rightPad = ltr ? padding.right : padding.left;
if (doPaintLeftIcon(comp)) { if (doPaintLeftIcon(comp)) {
Icon left = getLeftIcon(comp); Icon left = getLeftIcon(comp);
dim.width += left.getIconWidth() + leftPad; dim.width += left.getIconWidth() + leftPad;
@ -157,12 +156,12 @@ public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyCh
protected void adjustTextRect(final JTextComponent c, final Rectangle r) { protected void adjustTextRect(final JTextComponent c, final Rectangle r) {
boolean ltr = c.getComponentOrientation().isLeftToRight(); boolean ltr = c.getComponentOrientation().isLeftToRight();
if (doPaintLeftIcon(c)) { if (doPaintLeftIcon(c)) {
int w = getLeftIcon(c).getIconWidth() + padding.left; int w = getLeftIcon(c).getIconWidth() + buttonPad;
if (ltr) r.x += w; if (ltr) r.x += w;
r.width -= w; r.width -= w;
} }
if (doPaintRightIcon(c)) { if (doPaintRightIcon(c)) {
int w = getRightIcon(c).getIconWidth() + padding.right; int w = getRightIcon(c).getIconWidth() + buttonPad;
if (!ltr) r.x += w; if (!ltr) r.x += w;
r.width -= w; r.width -= w;
} }
@ -192,10 +191,10 @@ public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyCh
protected ClickAction getActionUnder(final Point p) { protected ClickAction getActionUnder(final Point p) {
JTextComponent c = getComponent(); JTextComponent c = getComponent();
if (!c.isEnabled()) return ClickAction.NONE; if (!c.isEnabled()) return ClickAction.NONE;
if (isOver(getRightIconCoord(), getRightIcon(c), p) && doPaintRightIcon(c)) { if (isOver(getRightIconPos(), getRightIcon(c), p) && doPaintRightIcon(c)) {
return ClickAction.RIGHT_ACTION; return ClickAction.RIGHT_ACTION;
} }
if (isOver(getLeftIconCoord(), getLeftIcon(c), p) && doPaintLeftIcon(c)) { if (isOver(getLeftIconPos(), getLeftIcon(c), p) && doPaintLeftIcon(c)) {
return ClickAction.LEFT_ACTION; return ClickAction.LEFT_ACTION;
} }
return ClickAction.NONE; return ClickAction.NONE;
@ -240,35 +239,43 @@ public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyCh
} }
protected void paintRightIcon(final Graphics g) { protected void paintRightIcon(final Graphics g) {
Point p = getRightIconCoord(); Point p = getRightIconPos();
getRightIcon(editor).paintIcon(null, g, p.x, p.y); getRightIcon(editor).paintIcon(null, g, p.x, p.y);
} }
protected void paintLeftIcon(final Graphics g) { protected void paintLeftIcon(final Graphics g) {
Point p = getLeftIconCoord(); Point p = getLeftIconPos();
getLeftIcon(editor).paintIcon(null, g, p.x, p.y); getLeftIcon(editor).paintIcon(null, g, p.x, p.y);
} }
protected Point getLeftIconCoord() { protected Point getLeftIconPos() {
Rectangle r = getDrawingRect(getComponent()); Rectangle r = getDrawingRect(getComponent());
int w = getLeftIcon(getComponent()).getIconWidth(); int iconSize = getLeftIcon(getComponent()).getIconWidth();
int left = getBorderInsets(getComponent()).left + padding.left; int y = getIconY(r, iconSize);
return DarkUIUtil.adjustForOrientation(new Point(r.x + left, r.y + (r.height - w) / 2), w, editor); return DarkUIUtil.adjustForOrientation(new Point(r.x + buttonPad, y), iconSize, editor);
} }
protected Point getRightIconCoord() { private int getIconY(final Rectangle r, final int iconSize) {
int contentHeight = r.height;
Insets margin = editor.getMargin();
if (margin != null) contentHeight -= margin.top + margin.bottom;
int y = r.y + (contentHeight - iconSize) / 2;
if (margin != null) y += margin.top;
return y;
}
protected Point getRightIconPos() {
Rectangle r = getDrawingRect(getComponent()); Rectangle r = getDrawingRect(getComponent());
int w = getRightIcon(getComponent()).getIconWidth(); int iconSize = getRightIcon(getComponent()).getIconWidth();
int right = getBorderInsets(getComponent()).right + padding.right; int y = getIconY(r, iconSize);
return DarkUIUtil.adjustForOrientation(new Point(r.x + r.width - w - right, r.y + (r.height - w) / 2), w, return DarkUIUtil.adjustForOrientation(new Point(r.x + r.width - iconSize - buttonPad, y), iconSize, editor);
editor);
} }
protected void showSearchPopup() { protected void showSearchPopup() {
if (lastSearchEvent == 0 || (System.currentTimeMillis() - lastSearchEvent) > 250) { if (lastSearchEvent == 0 || (System.currentTimeMillis() - lastSearchEvent) > 250) {
JPopupMenu menu = getSearchPopup(getComponent()); JPopupMenu menu = getSearchPopup(getComponent());
if (menu != null) { if (menu != null) {
menu.show(getComponent(), getLeftIconCoord().x, getComponent().getHeight()); menu.show(getComponent(), getLeftIconPos().x, getComponent().getHeight());
} }
} }
} }
@ -291,8 +298,7 @@ public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyCh
searchWithHistoryDisabled = UIManager.getIcon("TextField.search.searchWithHistory.disabled.icon"); searchWithHistoryDisabled = UIManager.getIcon("TextField.search.searchWithHistory.disabled.icon");
search = UIManager.getIcon("TextField.search.search.icon"); search = UIManager.getIcon("TextField.search.search.icon");
searchDisabled = UIManager.getIcon("TextField.search.search.disabled.icon"); searchDisabled = UIManager.getIcon("TextField.search.search.disabled.icon");
padding = UIManager.getInsets("TextField.insets"); buttonPad = UIManager.getInt("TextField.iconPad");
if (padding == null) padding = new Insets(0, 0, 0, 0);
} }
@Override @Override

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

@ -112,10 +112,18 @@ public abstract class DarkTextUI extends BasicTextUI
disabledColor = UIManager.getColor(getPropertyPrefix() + ".disabledBackground"); disabledColor = UIManager.getColor(getPropertyPrefix() + ".disabledBackground");
inactiveColor = UIManager.getColor(getPropertyPrefix() + ".inactiveBackground"); inactiveColor = UIManager.getColor(getPropertyPrefix() + ".inactiveBackground");
installMargins();
installBorder(); installBorder();
installPopupMenu(); installPopupMenu();
} }
protected void installMargins() {
Insets margin = editor.getMargin();
if (margin == null || margin instanceof UIResource) {
editor.setMargin(UIManager.getInsets(getPropertyPrefix() + ".margins"));
}
}
public static boolean isBorderlessTextField(final JTextComponent textComponent) { public static boolean isBorderlessTextField(final JTextComponent textComponent) {
if (textComponent == null) return false; if (textComponent == null) return false;
String className = textComponent.getClass().getName(); String className = textComponent.getClass().getName();
@ -365,15 +373,11 @@ public abstract class DarkTextUI extends BasicTextUI
if (b == null) { if (b == null) {
return new Insets(0, 0, 0, 0); return new Insets(0, 0, 0, 0);
} }
if (b instanceof DarkTextBorder) {
int bs = ((DarkTextBorder) b).getBorderSize();
return new Insets(bs, bs, bs, bs);
}
return b.getBorderInsets(c); return b.getBorderInsets(c);
} }
public Rectangle getDrawingRect(final JTextComponent c) { public Rectangle getDrawingRect(final JTextComponent c) {
return DarkUIUtil.applyInsets(new Rectangle(0, 0, c.getWidth(), c.getHeight()), getBorderInsets(c)); return DarkUIUtil.applyInsets(new Rectangle(c.getWidth(), c.getHeight()), getBorderInsets(c));
} }
protected void installDarkKeyBoardActions() { protected void installDarkKeyBoardActions() {

25
core/src/main/resources/com/github/weisj/darklaf/icons/menu/colorChooser.svg

@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="540" height="540">
<path fill="#FEFE33" d="M511.5,205.3l-21.3-13.2L415,218.7c5.7,16,8.8,33.3,8.8,51.3c0,18.5-3.3,36.3-9.3,52.8l72.8,26.6l24.2-14.6
C523.4,290.3,523.4,249.7,511.5,205.3z"/>
<path fill="#FB9902" d="M386.8,170l60.6-51.9l-0.6-24.9c-32.5-32.5-67.6-52.8-112.1-64.7l-21.6,12l-14.7,78.3
C333.5,125.4,364.5,143.9,386.8,170z"/>
<path fill="#FABC02"
d="M418.6,230.2l92.9-24.9c-11.9-44.4-32.2-79.5-64.7-112.1l-68,68C397.6,180.1,411.5,203.7,418.6,230.2z"/>
<path fill="#FE2712" d="M243.9,118.4l-12.7-73.9l-25.9-16c-44.4,11.9-79.5,32.2-112.1,64.7l-0.5,26.8l59.8,50.6 C175.5,143.7,207.5,124.6,243.9,118.4z"/>
<path fill="#FD5308" d="M270,116.2c13.8,0,27.1,1.8,39.8,5.2l24.9-92.9c-44.4-11.9-85-11.9-129.4,0l24.9,92.9
C242.9,118,256.2,116.2,270,116.2z"/>
<path fill="#8601AF" d="M116.2,270c0-19.7,3.7-38.6,10.5-55.9l-70.4-27.5l-27.8,18.7c-11.9,44.4-11.9,85,0,129.4l27.3,14.7
l69.9-25.9C119.6,306.8,116.2,288.8,116.2,270z"/>
<path fill="#A7194B"
d="M161.2,161.2l-68-68c-32.5,32.5-52.8,67.6-64.7,112.1l92.9,24.9C128.5,203.7,142.4,180.1,161.2,161.2z"/>
<path fill="#0247FE" d="M152.9,369.6l-57.5,48.9l-2.1,28.2c32.5,32.5,67.6,52.8,112.1,64.7l25.8-11.8l13.2-78.1
C207.9,415.5,175.8,396.6,152.9,369.6z"/>
<path fill="#3D01A4"
d="M28.5,334.7c11.9,44.4,32.2,79.5,64.7,112.1l68-68c-18.8-18.8-32.8-42.5-39.8-68.9L28.5,334.7z"/>
<path fill="#66B032" d="M446,421.2l-59.4-51c-22.6,26.3-54,44.9-89.6,51.2l13.4,75l24.3,15.1c44.4-11.9,79.5-32.2,112.1-64.7
L446,421.2z"/>
<path fill="#0391CE" d="M270,423.8c-13.8,0-27.1-1.8-39.8-5.2l-24.9,92.9c44.4,11.9,85,11.9,129.4,0l-24.9-92.9
C297.1,422,283.8,423.8,270,423.8z"/>
<path fill="#D0EA2B"
d="M418.6,309.8c-7.1,26.5-21,50.1-39.8,68.9l68,68c32.5-32.5,52.8-67.6,64.7-112.1L418.6,309.8z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

1
core/src/main/resources/com/github/weisj/darklaf/properties/icons/menu.properties

@ -50,3 +50,4 @@ Icons.themeSettings.color = %menuIconEnabled
Icons.Help.color = %menuIconEnabled Icons.Help.color = %menuIconEnabled
Icons.HelpHighlight.color = %questionIconColor Icons.HelpHighlight.color = %questionIconColor
Icons.HelpDisabled.color = %menuIconDisabled Icons.HelpDisabled.color = %menuIconDisabled
Icons.colorChooser.color = %menuIconEnabled

4
core/src/main/resources/com/github/weisj/darklaf/properties/ui/button.properties

@ -50,8 +50,8 @@ Button.borderThickness = %borderThickness
Button.shadowHeight = %shadowHeight Button.shadowHeight = %shadowHeight
Button.borderInsets = 5,14,5,14 Button.borderInsets = 5,14,5,14
Button.thinBorderInsets = 2,6,2,6 Button.thinBorderInsets = 3,6,3,6
Button.squareThinBorderInsets = 2,2,2,2 Button.squareThinBorderInsets = 3,3,3,3
Button.squareBorderInsets = 5,5,5,5 Button.squareBorderInsets = 5,5,5,5
Button.borderlessRectangularInsets = 0,0,0,0 Button.borderlessRectangularInsets = 0,0,0,0

1
core/src/main/resources/com/github/weisj/darklaf/properties/ui/colorChooser.properties

@ -46,5 +46,6 @@ ColorChooser.innerIndicatorRadius = 3
ColorChooser.background = %background ColorChooser.background = %background
#Icons #Icons
ColorChooser.icon = menu/colorChooser.svg
ColorChooser.pipette.icon = misc/pipette.svg[themed] ColorChooser.pipette.icon = misc/pipette.svg[themed]
ColorChooser.pipetteRollover.icon = misc/pipetteRollover.svg[themed] ColorChooser.pipetteRollover.icon = misc/pipetteRollover.svg[themed]

18
core/src/main/resources/com/github/weisj/darklaf/properties/ui/text.properties

@ -28,10 +28,6 @@ TextComponent.roundedSelection = true
TextComponent.selectionBackground = %textCompSelectionBackground TextComponent.selectionBackground = %textCompSelectionBackground
TextComponent.selectionForeground = %textCompSelectionForeground TextComponent.selectionForeground = %textCompSelectionForeground
EditorPaneUI = com.github.weisj.darklaf.ui.text.DarkEditorPaneUI
TextPaneUI = com.github.weisj.darklaf.ui.text.DarkTextPaneUI
TextAreaUI = com.github.weisj.darklaf.ui.text.DarkTextAreaUI
TextFieldUI = com.github.weisj.darklaf.ui.text.DarkTextFieldUI TextFieldUI = com.github.weisj.darklaf.ui.text.DarkTextFieldUI
TextField.border = com.github.weisj.darklaf.ui.text.DarkTextBorder TextField.border = com.github.weisj.darklaf.ui.text.DarkTextBorder
TextField.border.enabled = %widgetBorder TextField.border.enabled = %widgetBorder
@ -49,14 +45,16 @@ TextField.selectionBackground = %textCompSelectionBackground
TextField.selectionForeground = %textCompSelectionForeground TextField.selectionForeground = %textCompSelectionForeground
TextField.keepSelectionOnFocusLost = true TextField.keepSelectionOnFocusLost = true
TextField.extendSelection = false TextField.extendSelection = false
TextField.iconPad = 2
TextField.margins = 4,4,4,4
TextField.arc = 0 TextField.arc = 0
TextField.focusArc = %arcSecondaryFocus TextField.focusArc = %arcSecondaryFocus
TextField.searchArc = %arc TextField.searchArc = %arc
TextField.searchFocusArc = %arcFocus TextField.searchFocusArc = %arcFocus
TextField.borderThickness = %borderThickness TextField.borderThickness = %borderThickness
TextField.insets = 4,4,4,4
TextPaneUI = com.github.weisj.darklaf.ui.text.DarkTextPaneUI
TextPane.selectionBackground = %textCompSelectionBackground TextPane.selectionBackground = %textCompSelectionBackground
TextPane.selectionForeground = %textCompSelectionForeground TextPane.selectionForeground = %textCompSelectionForeground
TextPane.background = %textBackground TextPane.background = %textBackground
@ -65,8 +63,9 @@ TextPane.disabledBackground = %textBackgroundInactive
TextPane.inactiveBackground = %textBackgroundInactive TextPane.inactiveBackground = %textBackgroundInactive
TextPane.border = com.github.weisj.darklaf.ui.text.DarkPlainTextBorder TextPane.border = com.github.weisj.darklaf.ui.text.DarkPlainTextBorder
TextPane.extendSelection = true TextPane.extendSelection = true
TextPane.margins = 4,4,4,4
EditorPaneUI = com.github.weisj.darklaf.ui.text.DarkEditorPaneUI
EditorPane.selectionBackground = %textCompSelectionBackground EditorPane.selectionBackground = %textCompSelectionBackground
EditorPane.selectionForeground = %textCompSelectionForeground EditorPane.selectionForeground = %textCompSelectionForeground
EditorPane.inactiveForeground = %textForegroundInactive EditorPane.inactiveForeground = %textForegroundInactive
@ -75,8 +74,9 @@ EditorPane.disabledBackground = %textBackgroundInactive
EditorPane.inactiveBackground = %textBackgroundInactive EditorPane.inactiveBackground = %textBackgroundInactive
EditorPane.border = com.github.weisj.darklaf.ui.text.DarkPlainTextBorder EditorPane.border = com.github.weisj.darklaf.ui.text.DarkPlainTextBorder
EditorPane.extendSelection = true EditorPane.extendSelection = true
EditorPane.margins = 4,4,4,4
TextAreaUI = com.github.weisj.darklaf.ui.text.DarkTextAreaUI
TextArea.selectionBackground = %textCompSelectionBackground TextArea.selectionBackground = %textCompSelectionBackground
TextArea.selectionForeground = %textCompSelectionForeground TextArea.selectionForeground = %textCompSelectionForeground
TextArea.background = %textBackground TextArea.background = %textBackground
@ -84,6 +84,7 @@ TextArea.disabledBackground = %textBackgroundInactive
TextArea.inactiveBackground = %textBackgroundInactive TextArea.inactiveBackground = %textBackgroundInactive
TextArea.border = com.github.weisj.darklaf.ui.text.DarkPlainTextBorder TextArea.border = com.github.weisj.darklaf.ui.text.DarkPlainTextBorder
TextArea.extendSelection = false TextArea.extendSelection = false
TextArea.margins = 4,4,4,4
FormattedTextFieldUI = com.github.weisj.darklaf.ui.text.DarkFormattedTextFieldUI FormattedTextFieldUI = com.github.weisj.darklaf.ui.text.DarkFormattedTextFieldUI
FormattedTextField.border = com.github.weisj.darklaf.ui.text.DarkTextBorder FormattedTextField.border = com.github.weisj.darklaf.ui.text.DarkTextBorder
@ -94,7 +95,7 @@ FormattedTextField.extendSelection = false
FormattedTextField.selectionBackground = %textCompSelectionBackground FormattedTextField.selectionBackground = %textCompSelectionBackground
FormattedTextField.selectionForeground = %textCompSelectionForeground FormattedTextField.selectionForeground = %textCompSelectionForeground
FormattedTextField.margins = 4,4,4,4
PasswordFieldUI = com.github.weisj.darklaf.ui.text.DarkPasswordFieldUI PasswordFieldUI = com.github.weisj.darklaf.ui.text.DarkPasswordFieldUI
PasswordField.background = %textBackground PasswordField.background = %textBackground
@ -104,6 +105,7 @@ PasswordField.selectionBackground = %textCompSelectionBackground
PasswordField.selectionForeground = %textCompSelectionForeground PasswordField.selectionForeground = %textCompSelectionForeground
PasswordField.border = com.github.weisj.darklaf.ui.text.DarkTextBorder PasswordField.border = com.github.weisj.darklaf.ui.text.DarkTextBorder
PasswordField.extendSelection = false PasswordField.extendSelection = false
PasswordField.margins = 4,4,4,4
#Icons #Icons
PasswordField.show.icon = misc/eye.svg[themed] PasswordField.show.icon = misc/eye.svg[themed]

2
property-loader/src/main/java/com/github/weisj/darklaf/PropertyLoader.java

@ -189,7 +189,7 @@ public final class PropertyLoader {
} }
Object returnVal = new LoadError(); Object returnVal = new LoadError();
if (key.endsWith("Insets") || key.endsWith(".insets")) { if (key.endsWith("Insets") || key.endsWith(".insets") || key.endsWith(".margins")) {
returnVal = parseInsets(value, accumulator, currentDefaults, iconLoader); returnVal = parseInsets(value, accumulator, currentDefaults, iconLoader);
} else if (!skipObjects && (key.endsWith("Border") || key.endsWith(".border") || key.endsWith("Renderer"))) { } else if (!skipObjects && (key.endsWith("Border") || key.endsWith(".border") || key.endsWith("Renderer"))) {
return maybeWrap((UIDefaults.LazyValue) def -> parseObject(value), isFallback); return maybeWrap((UIDefaults.LazyValue) def -> parseObject(value), isFallback);

Loading…
Cancel
Save