From 41850fe2a137410ff7b38ae71f0e05c5ac8999cb Mon Sep 17 00:00:00 2001 From: Notmoo Date: Sat, 19 Aug 2017 19:19:22 +0200 Subject: [PATCH] =?UTF-8?q?Module=20Client,=20clss=20SideBar=20:=20correct?= =?UTF-8?q?ion=20du=20bug=20de=20disparition=20de=20la=20sidebar=20au=20d?= =?UTF-8?q?=C3=A9but=20de=20l'animation=20de=20collapse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/generics/others/SideBar.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/others/SideBar.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/others/SideBar.java index 94807320..d5c5351a 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/others/SideBar.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/components/generics/others/SideBar.java @@ -42,6 +42,7 @@ public class SideBar extends VBox { setCycleDuration(Duration.millis(250)); } protected void interpolate(double frac) { + SideBar.this.setVisible(true); final double curWidth = expandedWidth.getValue().doubleValue() * frac; setPrefWidth(curWidth); setTranslateX(-expandedWidth.getValue().doubleValue() + curWidth); @@ -64,9 +65,11 @@ public class SideBar extends VBox { setTranslateX(-expandedWidth.getValue().doubleValue() + curWidth); } }; - collapseSideBar.onFinishedProperty().set(actionEvent -> - Arrays.stream(listenerList.getListeners(ISideBarListener.class)) - .forEach(ISideBarListener::onCollapsedFinished)); + collapseSideBar.onFinishedProperty().set(actionEvent ->{ + setVisible(false); + Arrays.stream(listenerList.getListeners(ISideBarListener.class)) + .forEach(ISideBarListener::onCollapsedFinished); + }); collapse(); } @@ -74,7 +77,6 @@ public class SideBar extends VBox { if (expandSideBar.statusProperty().get() == Animation.Status.STOPPED && collapseSideBar.statusProperty().get() == Animation.Status.STOPPED) { if (!isVisible()) { - setVisible(true); expandSideBar.play(); } } @@ -85,7 +87,6 @@ public class SideBar extends VBox { && collapseSideBar.statusProperty().get() == Animation.Status.STOPPED) { if (isVisible()) { collapseSideBar.play(); - setVisible(false); } } }