mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-31 10:49:19 -04:00
add popup dropshadow if light mode or multiple centered
This commit is contained in:
parent
ba5b920ea4
commit
2687486b3a
1 changed files with 14 additions and 4 deletions
|
@ -35,6 +35,7 @@ import haveno.desktop.components.AutoTooltipCheckBox;
|
|||
import haveno.desktop.components.AutoTooltipLabel;
|
||||
import haveno.desktop.components.BusyAnimation;
|
||||
import haveno.desktop.main.MainView;
|
||||
import haveno.desktop.util.CssTheme;
|
||||
import haveno.desktop.util.FormBuilder;
|
||||
import haveno.desktop.util.GUIUtil;
|
||||
import haveno.desktop.util.Layout;
|
||||
|
@ -140,7 +141,7 @@ public abstract class Overlay<T extends Overlay<T>> {
|
|||
}
|
||||
}
|
||||
|
||||
private static int numOverlays = 0;
|
||||
private static int numCenterOverlays = 0;
|
||||
private static int numBlurEffects = 0;
|
||||
|
||||
protected final static double DEFAULT_WIDTH = 668;
|
||||
|
@ -251,7 +252,7 @@ public abstract class Overlay<T extends Overlay<T>> {
|
|||
|
||||
protected void animateHide() {
|
||||
animateHide(() -> {
|
||||
numOverlays--;
|
||||
if (isCentered()) numCenterOverlays--;
|
||||
removeEffectFromBackground();
|
||||
|
||||
if (stage != null)
|
||||
|
@ -544,8 +545,11 @@ public abstract class Overlay<T extends Overlay<T>> {
|
|||
|
||||
layout();
|
||||
|
||||
numOverlays++;
|
||||
if (numOverlays > 1) {
|
||||
// add dropshadow if light mode or multiple centered overlays
|
||||
if (isCentered()) {
|
||||
numCenterOverlays++;
|
||||
}
|
||||
if (!CssTheme.isDarkTheme() || numCenterOverlays > 1) {
|
||||
getRootContainer().getStyleClass().add("popup-dropshadow");
|
||||
}
|
||||
|
||||
|
@ -1091,4 +1095,10 @@ public abstract class Overlay<T extends Overlay<T>> {
|
|||
", message='" + message + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
private boolean isCentered() {
|
||||
if (type.animationType == AnimationType.SlideDownFromCenterTop) return false;
|
||||
if (type.animationType == AnimationType.SlideFromRightTop) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue