diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java index e7ecbc9b..9d1b8950 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java @@ -27,6 +27,8 @@ import javax.swing.border.Border; import javax.swing.plaf.InsetsUIResource; import javax.swing.plaf.UIResource; +import org.jetbrains.annotations.NotNull; + import com.github.weisj.darklaf.graphics.PaintUtil; import com.github.weisj.darklaf.ui.util.DarkUIUtil; import com.github.weisj.darklaf.util.AlignmentExt; @@ -34,7 +36,6 @@ import com.github.weisj.darklaf.util.PropertyUtil; import com.github.weisj.darklaf.util.graphics.GraphicsContext; import com.github.weisj.darklaf.util.graphics.GraphicsUtil; import com.github.weisj.swingdsl.visualpadding.VisualPaddingProvider; -import org.jetbrains.annotations.NotNull; /** @author Jannis Weis */ public class DarkButtonBorder implements Border, UIResource, VisualPaddingProvider { diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/splitbutton/DarkSplitButtonListener.java b/core/src/main/java/com/github/weisj/darklaf/ui/splitbutton/DarkSplitButtonListener.java index 2df2d9d5..7df1d947 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/splitbutton/DarkSplitButtonListener.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/splitbutton/DarkSplitButtonListener.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2019-2021 Jannis Weis + * Copyright (c) 2019-2022 Jannis Weis * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, @@ -79,7 +79,8 @@ public class DarkSplitButtonListener implements ActionListener, PropertyChangeLi @Override public void stateChanged(final ChangeEvent e) { ui.splitButton.repaint(); - if (!ui.splitButton.hasFocus() && ui.arrowButton.getModel().isPressed()) { + if (!ui.splitButton.hasFocus() && ui.arrowButton.isRequestFocusEnabled() + && ui.arrowButton.getModel().isPressed()) { ui.splitButton.requestFocusInWindow(); } }