diff --git a/core/src/main/java/com/github/weisj/darklaf/swingdsl/VisualPaddingListener.java b/core/src/main/java/com/github/weisj/darklaf/swingdsl/VisualPaddingListener.java index 0600339a..44da5177 100644 --- a/core/src/main/java/com/github/weisj/darklaf/swingdsl/VisualPaddingListener.java +++ b/core/src/main/java/com/github/weisj/darklaf/swingdsl/VisualPaddingListener.java @@ -30,6 +30,10 @@ import com.github.weisj.darklaf.util.Types; public class VisualPaddingListener implements PropertyChangeListener { + public VisualPaddingListener(final JComponent c) { + VisualPaddingUtil.updateProperty(c); + } + @Override public void propertyChange(final PropertyChangeEvent evt) { if (PropertyKey.BORDER.equals(evt.getPropertyName())) { diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java index f0e9906c..195bd235 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java @@ -152,7 +152,7 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants { super.installListeners(b); keyboardActions = new ToggleButtonFocusNavigationActions(b); keyboardActions.installActions(); - visualPaddingListener = new VisualPaddingListener(); + visualPaddingListener = new VisualPaddingListener(b); b.addPropertyChangeListener(visualPaddingListener); } 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 0d7ce1be..0dca25c8 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 @@ -112,7 +112,7 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements ComboBoxConstants comboBoxListener = createComboBoxListener(); comboBox.addMouseListener(comboBoxListener); comboBox.addPropertyChangeListener(comboBoxListener); - visualPaddingListener = new VisualPaddingListener(); + visualPaddingListener = new VisualPaddingListener(comboBox); comboBox.addPropertyChangeListener(visualPaddingListener); } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java index 8fb4479e..9fa3c471 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java @@ -97,7 +97,7 @@ public class DarkSpinnerUI extends BasicSpinnerUI implements SpinnerConstants { super.installListeners(); spinnerListener = createSpinnerListener(); spinnerListener.install(); - visualPaddingListener = new VisualPaddingListener(); + visualPaddingListener = new VisualPaddingListener(spinner); spinner.addPropertyChangeListener(visualPaddingListener); } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextUI.java index e6c6e9d1..c8c4ea60 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextUI.java @@ -190,7 +190,7 @@ public abstract class DarkTextUI extends BasicTextUI implements OpacityBufferedU textListener = createTextListener(); editor.addFocusListener(textListener); editor.addPropertyChangeListener(textListener); - visualPaddingListener = new VisualPaddingListener(); + visualPaddingListener = new VisualPaddingListener(editor); editor.addPropertyChangeListener(visualPaddingListener); } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/radiobutton/DarkRadioButtonUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/radiobutton/DarkRadioButtonUI.java index bf913347..cc04b227 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/radiobutton/DarkRadioButtonUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/radiobutton/DarkRadioButtonUI.java @@ -96,7 +96,7 @@ public class DarkRadioButtonUI extends MetalRadioButtonUI implements PropertyCha button.addPropertyChangeListener(this); keyboardAction = new ToggleButtonFocusNavigationActions(button); keyboardAction.installActions(); - visualPaddingListener = new VisualPaddingListener(); + visualPaddingListener = new VisualPaddingListener(button); button.addPropertyChangeListener(visualPaddingListener); }