diff --git a/src/mi2u/ui/PopupTable.java b/src/mi2u/ui/PopupTable.java index cff39fa..9d0e698 100644 --- a/src/mi2u/ui/PopupTable.java +++ b/src/mi2u/ui/PopupTable.java @@ -17,6 +17,7 @@ public class PopupTable extends Table{ public boolean shown = false; public float fromx, fromy; + public float popupDuration = 0.15f; public void popup(int align){ if(shown) return; @@ -24,19 +25,18 @@ public void popup(int align){ shown = true; setTransform(true); clearActions(); - float duration = 0.15f; if(Align.isTop(align)){ actions(Actions.scaleTo(1f,0f), Actions.translateBy(0f, getPrefHeight())); - actions(Actions.parallel(Actions.scaleTo(1f, 1f, duration, Interp.fade), Actions.translateBy(0f , -getPrefHeight(), duration, Interp.fade), Actions.run(this::keepInScreen))); + actions(Actions.parallel(Actions.scaleTo(1f, 1f, popupDuration, Interp.fade), Actions.translateBy(0f , -getPrefHeight(), popupDuration, Interp.fade), Actions.run(this::keepInScreen))); }else if(Align.isBottom(align)){ actions(Actions.scaleTo(1f,0f)); - actions(Actions.parallel(Actions.scaleTo(1f, 1f, duration, Interp.fade), Actions.run(this::keepInScreen))); + actions(Actions.parallel(Actions.scaleTo(1f, 1f, popupDuration, Interp.fade), Actions.run(this::keepInScreen))); }else if(Align.isLeft(align)){ actions(Actions.scaleTo(0f,1f)); - actions(Actions.parallel(Actions.scaleTo(1f, 1f, duration, Interp.fade), Actions.run(this::keepInScreen))); + actions(Actions.parallel(Actions.scaleTo(1f, 1f, popupDuration, Interp.fade), Actions.run(this::keepInScreen))); }else if(Align.isRight(align)){ actions(Actions.scaleTo(0f,1f), Actions.translateBy(getPrefWidth(), 0f)); - actions(Actions.parallel(Actions.scaleTo(1f, 1f, duration, Interp.fade), Actions.translateBy(-getPrefWidth() , 0f, duration, Interp.fade), Actions.run(this::keepInScreen))); + actions(Actions.parallel(Actions.scaleTo(1f, 1f, popupDuration, Interp.fade), Actions.translateBy(-getPrefWidth() , 0f, popupDuration, Interp.fade), Actions.run(this::keepInScreen))); } } @@ -45,7 +45,7 @@ public void popup(int align){ public void hide(){ if(!shown) return; shown = false; - actions(Actions.scaleTo(1f,0f, 0.15f, Interp.fade), Actions.delay(0.15f), Actions.remove()); + actions(Actions.scaleTo(1f,0f, popupDuration, Interp.fade), Actions.delay(popupDuration), Actions.remove()); } public void snapTo(Element e){ diff --git a/src/mi2u/ui/PowerGraphTable.java b/src/mi2u/ui/PowerGraphTable.java index 0bbe0bb..4255dd6 100644 --- a/src/mi2u/ui/PowerGraphTable.java +++ b/src/mi2u/ui/PowerGraphTable.java @@ -107,6 +107,7 @@ public void rebuild(){ public void showDetailFor(PGInfo info, MI2Bar bar){ detailTable.shown = false; + detailTable.popupDuration = 0.05f; detailTable.background(Styles.black6); detailTable.clearChildren(); buildInfo(detailTable, info);