Browse Source

use panel instead of grid.

pull/4074/head
Dan Walmsley 6 years ago
parent
commit
72fb2dd4b5
  1. 28
      src/Avalonia.Themes.Fluent/ProgressBar.xaml

28
src/Avalonia.Themes.Fluent/ProgressBar.xaml

@ -17,18 +17,16 @@
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Border x:Name="ProgressBarRoot" ClipToBounds="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{DynamicResource ControlCornerRadius}"> <Border x:Name="ProgressBarRoot" ClipToBounds="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{DynamicResource ControlCornerRadius}">
<Border CornerRadius="{DynamicResource ControlCornerRadius}"> <Panel>
<Grid> <Panel x:Name="DeterminateRoot">
<Grid x:Name="DeterminateRoot">
<Border CornerRadius="{DynamicResource ControlCornerRadius}" x:Name="PART_Indicator" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" /> <Border CornerRadius="{DynamicResource ControlCornerRadius}" x:Name="PART_Indicator" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" />
</Grid> </Panel>
<Grid x:Name="IndeterminateRoot"> <Panel x:Name="IndeterminateRoot">
<Border x:Name="IndeterminateProgressBarIndicator" CornerRadius="{DynamicResource ControlCornerRadius}" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" /> <Border x:Name="IndeterminateProgressBarIndicator" CornerRadius="{DynamicResource ControlCornerRadius}" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" />
<Border x:Name="IndeterminateProgressBarIndicator2" CornerRadius="{DynamicResource ControlCornerRadius}" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" /> <Border x:Name="IndeterminateProgressBarIndicator2" CornerRadius="{DynamicResource ControlCornerRadius}" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" />
</Grid> </Panel>
</Grid> </Panel>
</Border>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
@ -57,30 +55,30 @@
</Setter> </Setter>
</Style> </Style>
<!-- FadeInAnimation mockup--> <!-- FadeInAnimation mockup-->
<Style Selector="ProgressBar /template/ Grid#DeterminateRoot"> <Style Selector="ProgressBar /template/ Panel#DeterminateRoot">
<Setter Property="Transitions"> <Setter Property="Transitions">
<Transitions> <Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.197" /> <DoubleTransition Property="Opacity" Duration="0:0:0.197" />
</Transitions> </Transitions>
</Setter> </Setter>
</Style> </Style>
<Style Selector="ProgressBar /template/ Grid#IndeterminateRoot"> <Style Selector="ProgressBar /template/ Panel#IndeterminateRoot">
<Setter Property="Transitions"> <Setter Property="Transitions">
<Transitions> <Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.197" /> <DoubleTransition Property="Opacity" Duration="0:0:0.197" />
</Transitions> </Transitions>
</Setter> </Setter>
</Style> </Style>
<Style Selector="ProgressBar /template/ Grid#DeterminateRoot"> <Style Selector="ProgressBar /template/ Panel#DeterminateRoot">
<Setter Property="Opacity" Value="1" /> <Setter Property="Opacity" Value="1" />
</Style> </Style>
<Style Selector="ProgressBar /template/ Grid#IndeterminateRoot"> <Style Selector="ProgressBar /template/ Panel#IndeterminateRoot">
<Setter Property="Opacity" Value="0" /> <Setter Property="Opacity" Value="0" />
</Style> </Style>
<Style Selector="ProgressBar:indeterminate /template/ Grid#DeterminateRoot"> <Style Selector="ProgressBar:indeterminate /template/ Panel#DeterminateRoot">
<Setter Property="Opacity" Value="0" /> <Setter Property="Opacity" Value="0" />
</Style> </Style>
<Style Selector="ProgressBar:indeterminate /template/ Grid#IndeterminateRoot"> <Style Selector="ProgressBar:indeterminate /template/ Panel#IndeterminateRoot">
<Setter Property="Opacity" Value="1" /> <Setter Property="Opacity" Value="1" />
</Style> </Style>
<Style Selector="ProgressBar:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator"> <Style Selector="ProgressBar:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator">

Loading…
Cancel
Save