From 6ad299214483b4e4841f42451fe95f4b1a2bf287 Mon Sep 17 00:00:00 2001 From: real-zony Date: Sun, 30 Jun 2024 21:58:41 +0800 Subject: [PATCH] feat: Added some UI animation effects. --- src/ZonyLrcTools.Desktop/App.axaml | 3 +- .../Controls/DownloadStatusControl.axaml | 92 +++++++++++++++++++ .../Controls/DownloadStatusControl.axaml.cs | 36 ++++++++ src/ZonyLrcTools.Desktop/Pages/HomePage.axaml | 11 ++- 4 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 src/ZonyLrcTools.Desktop/Controls/DownloadStatusControl.axaml create mode 100644 src/ZonyLrcTools.Desktop/Controls/DownloadStatusControl.axaml.cs diff --git a/src/ZonyLrcTools.Desktop/App.axaml b/src/ZonyLrcTools.Desktop/App.axaml index 69ae1c4..75057c1 100644 --- a/src/ZonyLrcTools.Desktop/App.axaml +++ b/src/ZonyLrcTools.Desktop/App.axaml @@ -19,7 +19,7 @@ - + Microsoft YaHei, Simsun, Arial @@ -30,5 +30,6 @@ + \ No newline at end of file diff --git a/src/ZonyLrcTools.Desktop/Controls/DownloadStatusControl.axaml b/src/ZonyLrcTools.Desktop/Controls/DownloadStatusControl.axaml new file mode 100644 index 0000000..bb93aea --- /dev/null +++ b/src/ZonyLrcTools.Desktop/Controls/DownloadStatusControl.axaml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ZonyLrcTools.Desktop/Controls/DownloadStatusControl.axaml.cs b/src/ZonyLrcTools.Desktop/Controls/DownloadStatusControl.axaml.cs new file mode 100644 index 0000000..aa4258e --- /dev/null +++ b/src/ZonyLrcTools.Desktop/Controls/DownloadStatusControl.axaml.cs @@ -0,0 +1,36 @@ +using Avalonia; +using Avalonia.Controls.Primitives; +using FluentIcons.Common; +using ZonyLrcTools.Desktop.ViewModels; + +namespace ZonyLrcTools.Desktop.Controls; + +public class DownloadStatusControl : TemplatedControl +{ + public static readonly StyledProperty StatusProperty = + AvaloniaProperty.Register(nameof(Status)); + + public static readonly StyledProperty SymbolProperty = + AvaloniaProperty.Register(nameof(Symbol)); + + public static readonly StyledProperty TextProperty = + AvaloniaProperty.Register(nameof(Text)); + + public DownloadStatus Status + { + get => GetValue(StatusProperty); + set => SetValue(StatusProperty, value); + } + + public Symbol Symbol + { + get => GetValue(SymbolProperty); + set => SetValue(SymbolProperty, value); + } + + public string Text + { + get => GetValue(TextProperty); + set => SetValue(TextProperty, value); + } +} \ No newline at end of file diff --git a/src/ZonyLrcTools.Desktop/Pages/HomePage.axaml b/src/ZonyLrcTools.Desktop/Pages/HomePage.axaml index 7a5f156..96d3b60 100644 --- a/src/ZonyLrcTools.Desktop/Pages/HomePage.axaml +++ b/src/ZonyLrcTools.Desktop/Pages/HomePage.axaml @@ -3,10 +3,11 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewModels="clr-namespace:ZonyLrcTools.Desktop.ViewModels" + xmlns:controls="clr-namespace:ZonyLrcTools.Desktop.Controls" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="ZonyLrcTools.Desktop.Pages.HomePage" x:DataType="viewModels:HomeViewModel"> - + @@ -23,7 +24,13 @@ - + + + + + + +