Skip to content

fix: Expander header icon flip when collapsing or expanding canceled #13780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/Avalonia.Themes.Fluent/Controls/Expander.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
</ControlTemplate>
</Setter>

<Style Selector="^:checked /template/ Path#ExpandCollapseChevron">
<Style Selector="^[Tag=expanded] /template/ Path#ExpandCollapseChevron">
<Style.Animations>
<Animation FillMode="Both" Duration="0:0:0.0625">
<KeyFrame Cue="100%">
Expand All @@ -125,7 +125,7 @@
</Style.Animations>
</Style>

<Style Selector="^:not(:checked) /template/ Path#ExpandCollapseChevron">
<Style Selector="^[Tag=collapsed] /template/ Path#ExpandCollapseChevron">
<Style.Animations>
<Animation FillMode="Both" Duration="0:0:0.0625">
<KeyFrame Cue="0%">
Expand Down Expand Up @@ -262,8 +262,13 @@
<Setter Property="VerticalAlignment" Value="Stretch" />
</Style>

<Style Selector="^:expanded /template/ ToggleButton#ExpanderHeader">
<Setter Property="Tag" Value="expanded" />
</Style>

<Style Selector="^:not(:expanded) /template/ ToggleButton#ExpanderHeader">
<Setter Property="CornerRadius" Value="{Binding $parent[Expander].CornerRadius}" />
<Setter Property="Tag" Value="collapsed" />
</Style>
<Style Selector="^:expanded:up /template/ ToggleButton#ExpanderHeader">
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource BottomCornerRadiusFilterConverter}}" />
Expand Down