mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-19 23:36:00 -04:00
Add missing support to deactivate animations
This commit is contained in:
parent
415530c8ef
commit
4fc3b00fa4
@ -83,6 +83,8 @@ public final class Preferences implements Persistable {
|
||||
return defaultTradeCurrency;
|
||||
}
|
||||
|
||||
private static boolean _useAnimations = true;
|
||||
|
||||
transient private final Storage<Preferences> storage;
|
||||
transient private final BitsquareEnvironment bitsquareEnvironment;
|
||||
|
||||
@ -184,6 +186,7 @@ public final class Preferences implements Persistable {
|
||||
});
|
||||
useAnimationsProperty.addListener((ov) -> {
|
||||
useAnimations = useAnimationsProperty.get();
|
||||
_useAnimations = useAnimations;
|
||||
storage.queueUpForSave(2000);
|
||||
});
|
||||
fiatCurrenciesAsObservable.addListener((Observable ov) -> {
|
||||
@ -351,6 +354,10 @@ public final class Preferences implements Persistable {
|
||||
return useAnimationsProperty.get();
|
||||
}
|
||||
|
||||
public static boolean useAnimations() {
|
||||
return _useAnimations;
|
||||
}
|
||||
|
||||
public StringProperty btcDenominationProperty() {
|
||||
return btcDenominationProperty;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user