mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-03 00:00:55 +08:00
feat: implement for overlaypopup. change name.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -2,7 +2,7 @@ using Avalonia.Styling;
|
||||
|
||||
namespace Semi.Avalonia;
|
||||
|
||||
public class PopupAnimations: Styles
|
||||
public class SemiPopupAnimations: Styles
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user