Browse Source

TextField: Pass component to the icon being painted.

pull/235/head
weisj 4 years ago
parent
commit
48130902cc
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 12
      core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextFieldUI.java

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

@ -226,8 +226,8 @@ public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyCh
protected void paintIcons(final Graphics g) {
JTextComponent c = getComponent();
if (doPaintLeftIcon(c)) paintLeftIcon(g);
if (doPaintRightIcon(c)) paintRightIcon(g);
if (doPaintLeftIcon(c)) paintLeftIcon(c, g);
if (doPaintRightIcon(c)) paintRightIcon(c, g);
}
protected boolean doPaintLeftIcon(final JTextComponent c) {
@ -238,14 +238,14 @@ public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyCh
return c.isEditable() && c.getText().length() > 0 && showClearIcon(c);
}
protected void paintRightIcon(final Graphics g) {
protected void paintRightIcon(final Component c, final Graphics g) {
Point p = getRightIconPos();
getRightIcon(editor).paintIcon(null, g, p.x, p.y);
getRightIcon(editor).paintIcon(c, g, p.x, p.y);
}
protected void paintLeftIcon(final Graphics g) {
protected void paintLeftIcon(final Component c, final Graphics g) {
Point p = getLeftIconPos();
getLeftIcon(editor).paintIcon(null, g, p.x, p.y);
getLeftIcon(editor).paintIcon(c, g, p.x, p.y);
}
protected Point getLeftIconPos() {

Loading…
Cancel
Save