Browse Source

Ensure the JSpinners editor uses zero-size margins.

pull/214/head
weisj 4 years ago
parent
commit
91dbd8fc78
  1. 4
      core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java

4
core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java

@ -30,6 +30,7 @@ import javax.swing.border.EmptyBorder;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicSpinnerUI;
import javax.swing.text.JTextComponent;
import com.github.weisj.darklaf.components.ArrowButton;
import com.github.weisj.darklaf.ui.DividedWidgetPainter;
@ -145,6 +146,9 @@ public class DarkSpinnerUI extends BasicSpinnerUI implements SpinnerConstants {
} else {
editorComponent = editor;
}
if (editorComponent instanceof JTextComponent) {
((JTextComponent) editorComponent).setMargin(new Insets(0, 0, 0, 0));
}
editorComponent.addFocusListener(spinnerListener);
}

Loading…
Cancel
Save