feat: implement for overlaypopup. change name.

This commit is contained in:
rabbitism
2024-12-24 18:06:40 +08:00
parent f891e05e4c
commit f71e2630bb
4 changed files with 19 additions and 17 deletions

View File

@@ -7,7 +7,7 @@
<!-- You can still reference in old way. -->
<!-- <StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" /> -->
<semi:SemiTheme Locale="zh-cn" />
<semi:PopupAnimations/>
<semi:SemiPopupAnimations/>
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
</Application.Styles>

View File

@@ -1,5 +1,5 @@
<Styles xmlns="https://github.com/avaloniaui"
x:Class="Semi.Avalonia.PopupAnimations"
x:Class="Semi.Avalonia.SemiPopupAnimations"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Semi.Avalonia.Converters">
<Design.PreviewWith>
@@ -18,10 +18,10 @@
<Style Selector="Popup[IsOpen=True] LayoutTransformControl#PART_LayoutTransform">
<Style.Animations>
<Animation Duration="0:0:0.2" FillMode="Forward">
<Animation Duration="0:0:0.3" FillMode="Forward" Easing="CubicEaseIn">
<KeyFrame Cue="0.0">
<Setter Property="ScaleTransform.ScaleX" Value="0.95"/>
<Setter Property="ScaleTransform.ScaleY" Value="0.95"/>
<Setter Property="ScaleTransform.ScaleX" Value="0.98"/>
<Setter Property="ScaleTransform.ScaleY" Value="0.98"/>
</KeyFrame>
<KeyFrame Cue="1.0">
<Setter Property="ScaleTransform.ScaleX" Value="1.0"/>
@@ -32,15 +32,15 @@
</Style>
<Style Selector="Popup[IsOpen=False] LayoutTransformControl#PART_LayoutTransform">
<Style.Animations>
<Animation Duration="0:0:0.2" FillMode="Forward">
<Animation Duration="0:0:0.3" FillMode="Forward" Easing="CubicEaseOut">
<KeyFrame Cue="0.0">
<Setter Property="ScaleTransform.ScaleX" Value="0.95"/>
<Setter Property="ScaleTransform.ScaleY" Value="0.95"/>
</KeyFrame>
<KeyFrame Cue="1.0">
<Setter Property="ScaleTransform.ScaleX" Value="1.0"/>
<Setter Property="ScaleTransform.ScaleY" Value="1.0"/>
</KeyFrame>
<KeyFrame Cue="1.0">
<Setter Property="ScaleTransform.ScaleX" Value="0.98"/>
<Setter Property="ScaleTransform.ScaleY" Value="0.98"/>
</KeyFrame>
</Animation>
</Style.Animations>
</Style>

View File

@@ -2,7 +2,7 @@ using Avalonia.Styling;
namespace Semi.Avalonia;
public class PopupAnimations: Styles
public class SemiPopupAnimations: Styles
{
}

View File

@@ -31,12 +31,14 @@
<ControlTemplate>
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
<VisualLayerManager IsPopup="True">
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<LayoutTransformControl Name="PART_LayoutTransform">
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</LayoutTransformControl>
</VisualLayerManager>
</LayoutTransformControl>
</ControlTemplate>