From 2c2f93c982eefbf9eb3c36c31bf5788815dd0bd9 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Thu, 26 Mar 2026 19:58:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BADropdown=E7=9A=84=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BuildTime.txt | 2 +- GitCommit.txt | 2 +- Gui/UILib/Dropdown.cs | 36 ++++++++++++++++++++++++++++++------ 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/BuildTime.txt b/BuildTime.txt index 91cfde1..9bc983a 100644 --- a/BuildTime.txt +++ b/BuildTime.txt @@ -1 +1 @@ -2026-03-25 21:44:57 \ No newline at end of file +2026-03-26 19:55:43 \ No newline at end of file diff --git a/GitCommit.txt b/GitCommit.txt index a255276..92c6fb2 100644 --- a/GitCommit.txt +++ b/GitCommit.txt @@ -1 +1 @@ -b964430 \ No newline at end of file +b607cee \ No newline at end of file diff --git a/Gui/UILib/Dropdown.cs b/Gui/UILib/Dropdown.cs index 46d1b72..46cf130 100644 --- a/Gui/UILib/Dropdown.cs +++ b/Gui/UILib/Dropdown.cs @@ -190,7 +190,7 @@ namespace CMLeonOS.Gui.UILib closeAnimationRunning = true; int currentHeight = popupWindow.Height; - MovementAnimation animation = new MovementAnimation(popupWindow) + MovementAnimation windowAnimation = new MovementAnimation(popupWindow) { From = new Rectangle(popupWindow.X, popupWindow.Y, popupWindow.Width, currentHeight), To = new Rectangle(popupWindow.X, popupWindow.Y, popupWindow.Width, 1), @@ -198,7 +198,20 @@ namespace CMLeonOS.Gui.UILib EasingType = EasingType.Sine, EasingDirection = EasingDirection.In }; - animation.Completed = () => + MovementAnimation tableAnimation = null; + if (popupTable != null) + { + tableAnimation = new MovementAnimation(popupTable) + { + From = new Rectangle(popupTable.X, popupTable.Y, popupTable.Width, currentHeight), + To = new Rectangle(popupTable.X, popupTable.Y, popupTable.Width, 1), + Duration = 8, + EasingType = EasingType.Sine, + EasingDirection = EasingDirection.In + }; + } + + windowAnimation.Completed = () => { if (popupTable != null) { @@ -215,7 +228,8 @@ namespace CMLeonOS.Gui.UILib closeAnimationRunning = false; Render(); }; - animation.Start(); + windowAnimation.Start(); + tableAnimation?.Start(); } private void PopupSelected(int index) @@ -284,7 +298,7 @@ namespace CMLeonOS.Gui.UILib popupTable.Render(); WM.AddWindow(popupTable); - MovementAnimation animation = new MovementAnimation(popupWindow) + MovementAnimation windowAnimation = new MovementAnimation(popupWindow) { From = new Rectangle(popupWindow.X, popupWindow.Y, popupWindow.Width, 1), To = new Rectangle(popupWindow.X, popupWindow.Y, popupWindow.Width, popupHeight), @@ -292,7 +306,16 @@ namespace CMLeonOS.Gui.UILib EasingType = EasingType.Sine, EasingDirection = EasingDirection.Out }; - animation.Completed = () => + MovementAnimation tableAnimation = new MovementAnimation(popupTable) + { + From = new Rectangle(popupTable.X, popupTable.Y, popupTable.Width, 1), + To = new Rectangle(popupTable.X, popupTable.Y, popupTable.Width, popupHeight), + Duration = 8, + EasingType = EasingType.Sine, + EasingDirection = EasingDirection.Out + }; + + windowAnimation.Completed = () => { if (popupWindow != null) { @@ -306,7 +329,8 @@ namespace CMLeonOS.Gui.UILib popupTable.Render(); } }; - animation.Start(); + windowAnimation.Start(); + tableAnimation.Start(); } internal override void Render()