Browse Source

Ensure correct animation state after laf change.

pull/222/head
weisj 4 years ago
parent
commit
a0832252bd
  1. 2
      core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/DarkToggleButtonListener.java

2
core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/DarkToggleButtonListener.java

@ -44,6 +44,7 @@ public class DarkToggleButtonListener extends DarkButtonListener<DarkToggleButto
button = b; button = b;
animator = createAnimator(); animator = createAnimator();
animator.setEnabled(UIManager.getBoolean("ToggleButton.animated")); animator.setEnabled(UIManager.getBoolean("ToggleButton.animated"));
animator.state = selected ? 1 : 0;
} }
protected SliderAnimator createAnimator() { protected SliderAnimator createAnimator() {
@ -119,6 +120,7 @@ public class DarkToggleButtonListener extends DarkButtonListener<DarkToggleButto
@Override @Override
protected void paintCycleEnd() { protected void paintCycleEnd() {
System.out.println("here");
this.state = endValue; this.state = endValue;
repaint(); repaint();
animationBounds = null; animationBounds = null;

Loading…
Cancel
Save