From f830da7799dce88cb435d2ac082a5a936f14fde9 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:41:55 +0800 Subject: [PATCH] feat: animation. --- src/Ursa.Themes.Semi/Controls/Toast.axaml | 35 +++++++++---------- src/Ursa/Controls/Toast/Toast.cs | 3 +- src/Ursa/Controls/Toast/WindowToastManager.cs | 2 +- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/Ursa.Themes.Semi/Controls/Toast.axaml b/src/Ursa.Themes.Semi/Controls/Toast.axaml index e05f082..256140b 100644 --- a/src/Ursa.Themes.Semi/Controls/Toast.axaml +++ b/src/Ursa.Themes.Semi/Controls/Toast.axaml @@ -99,21 +99,18 @@ + Duration="0:0:0.3"> - - - - - - + + + + + - - @@ -124,18 +121,18 @@ + Duration="0:0:0.3"> - - - - - - + - - + + + + + + + @@ -146,7 +143,7 @@ + Duration="0:0:0.3"> diff --git a/src/Ursa/Controls/Toast/Toast.cs b/src/Ursa/Controls/Toast/Toast.cs index 1ec0acd..8352272 100644 --- a/src/Ursa/Controls/Toast/Toast.cs +++ b/src/Ursa/Controls/Toast/Toast.cs @@ -35,7 +35,8 @@ public class Toast : IToast, INotifyPropertyChanged { Content = content; Type = type; - Expiration = expiration ?? TimeSpan.FromSeconds(5); + Expiration = expiration ?? TimeSpan.FromSeconds(3); + ShowClose = showClose; OnClick = onClick; OnClose = onClose; } diff --git a/src/Ursa/Controls/Toast/WindowToastManager.cs b/src/Ursa/Controls/Toast/WindowToastManager.cs index 5d803a6..85d492f 100644 --- a/src/Ursa/Controls/Toast/WindowToastManager.cs +++ b/src/Ursa/Controls/Toast/WindowToastManager.cs @@ -146,7 +146,7 @@ public class WindowToastManager : TemplatedControl, IManagedToastManager return; } - await Task.Delay(expiration ?? TimeSpan.FromSeconds(5)); + await Task.Delay(expiration ?? TimeSpan.FromSeconds(3)); toastControl.Close(); }