Add missing support to deactivate animations

This commit is contained in:
Manfred Karrer 2016-03-11 12:57:40 +01:00
parent 415530c8ef
commit 4fc3b00fa4
3 changed files with 12 additions and 7 deletions

View file

@ -740,11 +740,8 @@ public abstract class Overlay<T extends Overlay> {
truncatedMessage = message;
}
private int getDuration(int duration) {
if (preferences != null)
return preferences.getUseAnimations() ? duration : 1;
else
return duration;
protected int getDuration(int duration) {
return Preferences.useAnimations() ? duration : 1;
}
@Override

View file

@ -94,7 +94,7 @@ public class Notification extends Overlay<Notification> {
}
if (NotificationCenter.useAnimations) {
double duration = 400;
double duration = getDuration(400);
Interpolator interpolator = Interpolator.SPLINE(0.25, 0.1, 0.25, 1);
gridPane.setRotationAxis(Rotate.X_AXIS);
@ -127,7 +127,7 @@ public class Notification extends Overlay<Notification> {
protected void animateDisplay() {
if (NotificationCenter.useAnimations) {
double startX = 320;
double duration = 600;
double duration = getDuration(600);
Interpolator interpolator = Interpolator.SPLINE(0.25, 0.1, 0.25, 1);
Timeline timeline = new Timeline();
@ -154,6 +154,7 @@ public class Notification extends Overlay<Notification> {
}
}
@Override
protected void createGridPane() {
super.createGridPane();