Browse Source

fix: reverse TickBar when Slider direction is reversed (#19096)

release/11.3.2
yoyo 8 months ago
committed by Julien Lebosquain
parent
commit
64f61e3e57
  1. 9
      samples/ControlCatalog/Pages/SliderPage.xaml
  2. 6
      src/Avalonia.Themes.Fluent/Controls/Slider.xaml

9
samples/ControlCatalog/Pages/SliderPage.xaml

@ -21,6 +21,15 @@
IsSnapToTickEnabled="True" IsSnapToTickEnabled="True"
Ticks="0,20,25,40,75,100" Ticks="0,20,25,40,75,100"
Width="300" /> Width="300" />
<Slider Name="ReversedTickedSlider"
Value="0"
Minimum="0"
Maximum="100"
TickPlacement="BottomRight"
IsSnapToTickEnabled="True"
IsDirectionReversed="True"
Ticks="0,20,25,40,75,100"
Width="300" />
<Slider Name="SliderWithTooltip" <Slider Name="SliderWithTooltip"
Value="0" Value="0"
Minimum="0" Minimum="0"

6
src/Avalonia.Themes.Fluent/Controls/Slider.xaml

@ -129,6 +129,7 @@
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Placement="Top" Placement="Top"
IsVisible="False" IsVisible="False"
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
Fill="{DynamicResource SliderTickBarFill}"/> Fill="{DynamicResource SliderTickBarFill}"/>
<TickBar <TickBar
Name="BottomTickBar" Name="BottomTickBar"
@ -144,6 +145,7 @@
VerticalAlignment="Top" VerticalAlignment="Top"
Placement="Bottom" Placement="Bottom"
IsVisible="False" IsVisible="False"
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
Fill="{DynamicResource SliderTickBarFill}" /> Fill="{DynamicResource SliderTickBarFill}" />
<Track <Track
Name="PART_Track" Name="PART_Track"
@ -225,8 +227,9 @@
HorizontalAlignment="Right" HorizontalAlignment="Right"
Placement="Left" Placement="Left"
IsVisible="False" IsVisible="False"
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
Fill="{DynamicResource SliderTickBarFill}"/> Fill="{DynamicResource SliderTickBarFill}"/>
<TickBar <TickBar
Name="RightTickBar" Name="RightTickBar"
Grid.RowSpan="3" Grid.RowSpan="3"
Grid.Column="2" Grid.Column="2"
@ -240,6 +243,7 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
Placement="Right" Placement="Right"
IsVisible="False" IsVisible="False"
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
Fill="{DynamicResource SliderTickBarFill}"/> Fill="{DynamicResource SliderTickBarFill}"/>
<Track <Track
Name="PART_Track" Name="PART_Track"

Loading…
Cancel
Save