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

Loading…
Cancel
Save