Merge pull request #97 from irihitech/loading2

Optimize Loading
This commit is contained in:
Dong Bin
2024-02-07 00:04:10 +08:00
committed by GitHub

View File

@@ -2,7 +2,8 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters" xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters"
xmlns:u="clr-namespace:Ursa.Controls;assembly=Ursa"> xmlns:u="clr-namespace:Ursa.Controls;assembly=Ursa"
xmlns:shapes="clr-namespace:Ursa.Controls.Shapes;assembly=Ursa">
<!-- Add Resources Here --> <!-- Add Resources Here -->
<converters:BrushToColorConverter x:Key="BrushToColorConverter" /> <converters:BrushToColorConverter x:Key="BrushToColorConverter" />
<ControlTheme x:Key="{x:Type u:LoadingIcon}" TargetType="u:LoadingIcon"> <ControlTheme x:Key="{x:Type u:LoadingIcon}" TargetType="u:LoadingIcon">
@@ -12,6 +13,7 @@
<Arc <Arc
Name="PART_Arc" Name="PART_Arc"
Width="20" Width="20"
IsVisible="{TemplateBinding IsVisible}"
Height="20" Height="20"
StartAngle="0" StartAngle="0"
StrokeJoin="Round" StrokeJoin="Round"
@@ -28,7 +30,7 @@
</ConicGradientBrush> </ConicGradientBrush>
</Arc.Stroke> </Arc.Stroke>
<Arc.Styles> <Arc.Styles>
<Style Selector="Arc"> <Style Selector="Arc[IsVisible=True]">
<Style.Animations> <Style.Animations>
<Animation IterationCount="Infinite" Duration="0:0:0.5"> <Animation IterationCount="Infinite" Duration="0:0:0.5">
<KeyFrame Cue="0%"> <KeyFrame Cue="0%">
@@ -66,7 +68,7 @@
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="u:Loading"> <ControlTemplate TargetType="u:Loading">
<Panel IsVisible="{TemplateBinding IsLoading}"> <Panel IsVisible="{TemplateBinding IsLoading}">
<Border <shapes:PureRectangle
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Background="{TemplateBinding Background}" /> Background="{TemplateBinding Background}" />