diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxBorder.java index 25b4adec..f3c6dae8 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxBorder.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxBorder.java @@ -123,8 +123,7 @@ public class DarkComboBoxBorder implements Border, UIResource { public Insets getBorderInsets(final Component c) { if (ComboBoxConstants.isTreeOrTableCellEditor(c)) { return CellUtil.adjustEditorInsets(new InsetsUIResource(cellPadding.top, cellPadding.left, - cellPadding.bottom, cellPadding.right), - c); + cellPadding.bottom, cellPadding.right), c); } if (c.getComponentOrientation().isLeftToRight()) { return new InsetsUIResource(boxPadding.top, boxPadding.left, boxPadding.bottom, borderSize); diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java index c44ae638..14d91568 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java @@ -191,7 +191,9 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements ComboBoxConstants public void paint(final Graphics g, final JComponent c) { paintBackground(g, c, c.getWidth(), c.getHeight()); Rectangle r = rectangleForCurrentValue(); - paintCurrentValue(g, r, hasFocus); + if (!comboBox.isEditable()) { + paintCurrentValue(g, r, hasFocus); + } } private void paintBackground(final Graphics g, final JComponent c, final int width, final int height) { diff --git a/core/src/main/resources/com/github/weisj/darklaf/properties/ui/comboBox.properties b/core/src/main/resources/com/github/weisj/darklaf/properties/ui/comboBox.properties index 609a11ff..aa5af147 100644 --- a/core/src/main/resources/com/github/weisj/darklaf/properties/ui/comboBox.properties +++ b/core/src/main/resources/com/github/weisj/darklaf/properties/ui/comboBox.properties @@ -39,7 +39,7 @@ ComboBox.arc = %arc ComboBox.borderThickness = %borderThickness ComboBox.selectionForeground = %textSelectionForeground ComboBox.insets = 5,5,5,5 -ComboBox.cellEditorInsets = 0,0,0,0 +ComboBox.cellEditorInsets = 1,0,1,0 ComboBox.buttonPad = 4 #Icons diff --git a/core/src/test/java/ui/spinner/SpinnerDemo.java b/core/src/test/java/ui/spinner/SpinnerDemo.java index af7cf622..88d4f547 100644 --- a/core/src/test/java/ui/spinner/SpinnerDemo.java +++ b/core/src/test/java/ui/spinner/SpinnerDemo.java @@ -23,6 +23,7 @@ */ package ui.spinner; +import com.github.weisj.darklaf.ui.spinner.SpinnerConstants; import ui.ComponentDemo; import ui.DemoPanel; @@ -50,16 +51,18 @@ public class SpinnerDemo implements ComponentDemo { addActionListener(e -> spinner.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT : ComponentOrientation.RIGHT_TO_LEFT)); }}); - controlPanel.add(new JCheckBox("JSpinner.variant = plusMinus") {{ - addActionListener(e -> spinner.putClientProperty("JSpinner.variant", isSelected() ? "plusMinus" : null)); + controlPanel.add(new JCheckBox(SpinnerConstants.KEY_VARIANT + " = " + SpinnerConstants.VARIANT_PLUS_MINUS) {{ + addActionListener(e -> spinner.putClientProperty(SpinnerConstants.KEY_VARIANT, + isSelected() ? SpinnerConstants.VARIANT_PLUS_MINUS + : null)); }}); - controlPanel.add(new JCheckBox("JSpinner.isTreeCellEditor") {{ + controlPanel.add(new JCheckBox(SpinnerConstants.KEY_IS_TREE_EDITOR) {{ setSelected(false); - addActionListener(e -> spinner.putClientProperty("JSpinner.isTreeCellEditor", isSelected())); + addActionListener(e -> spinner.putClientProperty(SpinnerConstants.KEY_IS_TREE_EDITOR, isSelected())); }}); - controlPanel.add(new JCheckBox("JSpinner.isTableCellEditor") {{ + controlPanel.add(new JCheckBox(SpinnerConstants.KEY_IS_TABLE_EDITOR) {{ setSelected(false); - addActionListener(e -> spinner.putClientProperty("JSpinner.isTableCellEditor", isSelected())); + addActionListener(e -> spinner.putClientProperty(SpinnerConstants.KEY_IS_TABLE_EDITOR, isSelected())); }}); return panel; }