mirror of
				https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
				synced 2025-10-31 09:03:08 +00:00 
			
		
		
		
	Module Client, clss SideBar : correction du bug de disparition de la sidebar au début de l'animation de collapse
This commit is contained in:
		| @@ -42,6 +42,7 @@ public class SideBar extends VBox { | |||||||
|                 setCycleDuration(Duration.millis(250)); |                 setCycleDuration(Duration.millis(250)); | ||||||
|             } |             } | ||||||
|             protected void interpolate(double frac) { |             protected void interpolate(double frac) { | ||||||
|  |                 SideBar.this.setVisible(true); | ||||||
|                 final double curWidth = expandedWidth.getValue().doubleValue() * frac; |                 final double curWidth = expandedWidth.getValue().doubleValue() * frac; | ||||||
|                 setPrefWidth(curWidth); |                 setPrefWidth(curWidth); | ||||||
|                 setTranslateX(-expandedWidth.getValue().doubleValue() + curWidth); |                 setTranslateX(-expandedWidth.getValue().doubleValue() + curWidth); | ||||||
| @@ -64,9 +65,11 @@ public class SideBar extends VBox { | |||||||
|                 setTranslateX(-expandedWidth.getValue().doubleValue() + curWidth); |                 setTranslateX(-expandedWidth.getValue().doubleValue() + curWidth); | ||||||
|             } |             } | ||||||
|         }; |         }; | ||||||
|         collapseSideBar.onFinishedProperty().set(actionEvent -> |         collapseSideBar.onFinishedProperty().set(actionEvent ->{ | ||||||
|                 Arrays.stream(listenerList.getListeners(ISideBarListener.class)) |             setVisible(false); | ||||||
|                         .forEach(ISideBarListener::onCollapsedFinished)); |             Arrays.stream(listenerList.getListeners(ISideBarListener.class)) | ||||||
|  |                     .forEach(ISideBarListener::onCollapsedFinished); | ||||||
|  |         }); | ||||||
|         collapse(); |         collapse(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -74,7 +77,6 @@ public class SideBar extends VBox { | |||||||
|         if (expandSideBar.statusProperty().get() == Animation.Status.STOPPED |         if (expandSideBar.statusProperty().get() == Animation.Status.STOPPED | ||||||
|                 && collapseSideBar.statusProperty().get() == Animation.Status.STOPPED) { |                 && collapseSideBar.statusProperty().get() == Animation.Status.STOPPED) { | ||||||
|             if (!isVisible()) { |             if (!isVisible()) { | ||||||
|                 setVisible(true); |  | ||||||
|                 expandSideBar.play(); |                 expandSideBar.play(); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @@ -85,7 +87,6 @@ public class SideBar extends VBox { | |||||||
|                 && collapseSideBar.statusProperty().get() == Animation.Status.STOPPED) { |                 && collapseSideBar.statusProperty().get() == Animation.Status.STOPPED) { | ||||||
|             if (isVisible()) { |             if (isVisible()) { | ||||||
|                 collapseSideBar.play(); |                 collapseSideBar.play(); | ||||||
|                 setVisible(false); |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user