mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-24 23:00:36 -04:00
fix popup blur and dropshadow counts
This commit is contained in:
parent
c3c8487682
commit
f71e38c87d
1 changed files with 6 additions and 3 deletions
|
@ -139,6 +139,7 @@ public abstract class Overlay<T extends Overlay<T>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int numOverlays = 0;
|
private static int numOverlays = 0;
|
||||||
|
private static int numBlurEffects = 0;
|
||||||
|
|
||||||
protected final static double DEFAULT_WIDTH = 668;
|
protected final static double DEFAULT_WIDTH = 668;
|
||||||
protected Stage stage;
|
protected Stage stage;
|
||||||
|
@ -242,13 +243,13 @@ public abstract class Overlay<T extends Overlay<T>> {
|
||||||
if (gridPane != null) {
|
if (gridPane != null) {
|
||||||
animateHide();
|
animateHide();
|
||||||
}
|
}
|
||||||
|
numOverlays--;
|
||||||
isDisplayed = false;
|
isDisplayed = false;
|
||||||
isHiddenProperty.set(true);
|
isHiddenProperty.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void animateHide() {
|
protected void animateHide() {
|
||||||
animateHide(() -> {
|
animateHide(() -> {
|
||||||
numOverlays--;
|
|
||||||
removeEffectFromBackground();
|
removeEffectFromBackground();
|
||||||
|
|
||||||
if (stage != null)
|
if (stage != null)
|
||||||
|
@ -744,7 +745,8 @@ public abstract class Overlay<T extends Overlay<T>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addEffectToBackground() {
|
protected void addEffectToBackground() {
|
||||||
if (numOverlays > 1) return;
|
numBlurEffects++;
|
||||||
|
if (numBlurEffects > 1) return;
|
||||||
if (type.changeBackgroundType == ChangeBackgroundType.BlurUltraLight)
|
if (type.changeBackgroundType == ChangeBackgroundType.BlurUltraLight)
|
||||||
MainView.blurUltraLight();
|
MainView.blurUltraLight();
|
||||||
else if (type.changeBackgroundType == ChangeBackgroundType.BlurLight)
|
else if (type.changeBackgroundType == ChangeBackgroundType.BlurLight)
|
||||||
|
@ -814,7 +816,8 @@ public abstract class Overlay<T extends Overlay<T>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removeEffectFromBackground() {
|
protected void removeEffectFromBackground() {
|
||||||
if (numOverlays > 0) return;
|
numBlurEffects--;
|
||||||
|
if (numBlurEffects > 0) return;
|
||||||
MainView.removeEffect();
|
MainView.removeEffect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue