misc: enhance Switch.

(cherry picked from commit 142abbf3da7b31494961715c1cf5bc29ccaee24e)
This commit is contained in:
Zhang Dian 2024-11-29 23:47:24 +08:00
parent 52738987f7
commit f3aad8d0d4

View File

@ -15,6 +15,7 @@
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="FocusAdorner">
<FocusAdornerTemplate>
<Border Theme="{DynamicResource AdornerLayerBorder}"
@ -66,7 +67,7 @@
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
HorizontalAlignment="Left">
<Grid
<Panel
Name="PART_MovingKnobs"
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
@ -107,7 +108,7 @@
</Style>
</Arc.Styles>
</Arc>
</Grid>
</Panel>
</Canvas>
</Border>
@ -205,7 +206,7 @@
<Setter Property="Width" Value="{DynamicResource ToggleSwitchIndicatorSmallWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchIndicatorSmallWidth}" />
</Style>
<Style Selector="^ /template/ Grid#PART_MovingKnobs">
<Style Selector="^ /template/ Panel#PART_MovingKnobs">
<Setter Property="Width" Value="{DynamicResource ToggleSwitchIndicatorSmallWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchIndicatorSmallWidth}" />
<Setter Property="Margin" Value="{DynamicResource ToggleSwitchIndicatorSmallMargin}" />
@ -223,7 +224,7 @@
<Setter Property="Width" Value="{DynamicResource ToggleSwitchIndicatorLargeWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchIndicatorLargeWidth}" />
</Style>
<Style Selector="^ /template/ Grid#PART_MovingKnobs">
<Style Selector="^ /template/ Panel#PART_MovingKnobs">
<Setter Property="Width" Value="{DynamicResource ToggleSwitchIndicatorLargeWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchIndicatorLargeWidth}" />
<Setter Property="Margin" Value="{DynamicResource ToggleSwitchIndicatorLargeMargin}" />
@ -246,7 +247,6 @@
<Border
Name="SwitchBackgroundBorder"
Background="{TemplateBinding Background}"
Cursor="Hand"
Width="{DynamicResource ToggleSwitchDefaultWidth}"
Height="{DynamicResource ToggleSwitchDefaultHeight}"
BorderBrush="{DynamicResource ToggleSwitchDefaultBorderBrush}"
@ -266,7 +266,7 @@
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
HorizontalAlignment="Left">
<Grid
<Panel
Name="PART_MovingKnobs"
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
@ -307,7 +307,7 @@
</Style>
</Arc.Styles>
</Arc>
</Grid>
</Panel>
</Canvas>
<ContentPresenter
Name="PART_OnContentPresenter"