feat: enhance NavMenu Transitions.

This commit is contained in:
Zhang Dian
2025-02-13 17:30:28 +08:00
parent 717509d1d4
commit abd3e292c7
2 changed files with 7 additions and 5 deletions

View File

@@ -97,7 +97,7 @@
Foreground="{DynamicResource NavigationMenuItemExpandIconForeground}">
<PathIcon.Transitions>
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0.1" />
<TransformOperationsTransition Property="RenderTransform" Duration="0.2" />
</Transitions>
</PathIcon.Transitions>
</PathIcon>
@@ -131,8 +131,9 @@
RenderTransformOrigin="0.5,0">
<ItemsPresenter.Transitions>
<Transitions>
<DoubleTransition Property="Height" Duration="0.1" />
<TransformOperationsTransition Property="RenderTransform" Duration="0.1" />
<DoubleTransition Easing="QuadraticEaseIn" Property="Height" Duration="0.25" />
<DoubleTransition Easing="QuadraticEaseOut" Property="Opacity" Duration="0.25" />
<!-- <TransformOperationsTransition Easing="QuadraticEaseIn" Property="RenderTransform" Duration="0.25" /> -->
</Transitions>
</ItemsPresenter.Transitions>
</ItemsPresenter>
@@ -157,7 +158,8 @@
</Style>
<Style Selector="^:vertical-collapsed /template/ ItemsPresenter#PART_ItemsPresenter">
<Setter Property="Height" Value="0" />
<Setter Property="RenderTransform" Value="scale(1,0)" />
<Setter Property="Opacity" Value="0" />
<!-- <Setter Property="RenderTransform" Value="scale(1,0)" /> -->
</Style>
<Style Selector="^:vertical-collapsed /template/ PathIcon#PART_ExpanderIcon">
<Setter Property="RenderTransform" Value="rotate(180deg)" />

View File

@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="NavigationMenuItemExpandIconGlyph" ResourceKey="SemiIconChevronDown" />
<StaticResource x:Key="NavigationMenuItemExpandIconGlyph" ResourceKey="SemiIconChevronUp" />
<x:Double x:Key="NavigationMenuExpandWidth">260</x:Double>
<x:Double x:Key="NavigationMenuClosedWidth">80</x:Double>