misc: sync RadioButton.

This commit is contained in:
Zhang Dian
2025-04-21 20:26:03 +08:00
parent 391e558721
commit 7641a94a5a

View File

@@ -72,33 +72,23 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<!-- Unchecked State -->
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Style Selector="^ /template/ Ellipse#CheckGlyph">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDefaultBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDefaultBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDefaultBackground}" /> <Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDefaultBackground}" />
</Style> </Style>
<Style Selector="^ /template/ Ellipse#CheckGlyph"> <Style Selector="^:pointerover /template/ Ellipse#OuterEllipse">
<Setter Property="Opacity" Value="0" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPointeroverBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconPointeroverBackground}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Ellipse#OuterEllipse">
<!-- Unchecked Pointerover State --> <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPressedBorderBrush}" />
<Style Selector="^:pointerover"> <Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconPressedBackground}" />
<Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPointeroverBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconPointeroverBackground}" />
</Style>
</Style> </Style>
<!-- Unchecked Pressed State -->
<Style Selector="^:pressed">
<Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPressedBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconPressedBackground}" />
</Style>
</Style>
<!-- Unchecked Disabled state -->
<Style Selector="^:disabled"> <Style Selector="^:disabled">
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDisabledBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDisabledBorderBrush}" />
@@ -110,37 +100,28 @@
</Style> </Style>
</Style> </Style>
<!-- Checked State -->
<Style Selector="^:checked"> <Style Selector="^:checked">
<Style Selector="^ /template/ Ellipse#CheckGlyph">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDefaultBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDefaultBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDefaultBackground}" /> <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDefaultBackground}" />
</Style> </Style>
<Style Selector="^ /template/ Ellipse#CheckGlyph"> <Style Selector="^:pointerover /template/ Ellipse#OuterEllipse">
<Setter Property="Opacity" Value="1" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Ellipse#OuterEllipse">
<!-- Checked Pointerover State --> <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPressedBorderBrush}" />
<Style Selector="^:pointerover"> <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPressedBackground}" />
<Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" />
</Style>
</Style> </Style>
<!-- Checked Pressed State -->
<Style Selector="^:pressed">
<Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPressedBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPressedBackground}" />
</Style>
</Style>
<!-- Checked Disabled State -->
<Style Selector="^:disabled"> <Style Selector="^:disabled">
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDisabledBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDisabledBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" /> <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
<Setter Property="Opacity" Value="0.75" />
</Style> </Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
@@ -271,33 +252,31 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<!-- Unchecked State -->
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Style Selector="^ /template/ Ellipse#CheckGlyph">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDefaultBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDefaultBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDefaultBackground}" /> <Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDefaultBackground}" />
</Style> </Style>
<Style Selector="^ /template/ Ellipse#CheckGlyph">
<Setter Property="Opacity" Value="0" />
</Style>
<!-- Unchecked Pointerover State -->
<Style Selector="^:pointerover"> <Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPointeroverBackground}" />
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPointeroverBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPointeroverBackground}" />
</Style>
</Style> </Style>
<!-- Unchecked Pressed State -->
<Style Selector="^:pressed"> <Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPressedBackground}" />
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPressedBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPressedBorderBrush}" />
</Style> </Style>
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPressedBackground}" />
</Style>
</Style> </Style>
<!-- Unchecked Disabled state -->
<Style Selector="^:disabled"> <Style Selector="^:disabled">
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDisabledBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDisabledBorderBrush}" />
@@ -309,45 +288,42 @@
</Style> </Style>
</Style> </Style>
<!-- Checked State -->
<Style Selector="^:checked"> <Style Selector="^:checked">
<Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" /> <Style Selector="^ /template/ Ellipse#CheckGlyph">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckDefaultBorderBrush}" /> <Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDefaultBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDefaultBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDefaultBackground}" /> <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDefaultBackground}" />
</Style> </Style>
<Style Selector="^ /template/ Ellipse#CheckGlyph"> <Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Opacity" Value="1" /> <Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckDefaultBorderBrush}" />
</Style> </Style>
<!-- Checked Pointerover State -->
<Style Selector="^:pointerover"> <Style Selector="^:pointerover">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPointeroverBorderBrush}" />
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" /> <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" />
</Style> </Style>
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPointeroverBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" />
</Style> </Style>
</Style> </Style>
<!-- Checked Pressed State -->
<Style Selector="^:pressed"> <Style Selector="^:pressed">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPressedBorderBrush}" />
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPressedBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPressedBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPressedBackground}" /> <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPressedBackground}" />
</Style> </Style>
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPressedBorderBrush}" />
</Style>
</Style> </Style>
<!-- Checked Disabled State -->
<Style Selector="^:disabled"> <Style Selector="^:disabled">
<Style Selector="^ /template/ Ellipse#OuterEllipse"> <Style Selector="^ /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDisabledBorderBrush}" /> <Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDisabledBorderBrush}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" /> <Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
<Setter Property="Opacity" Value="0.75" />
</Style> </Style>
<Style Selector="^ /template/ Border#RootBorder"> <Style Selector="^ /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" /> <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
@@ -389,36 +365,35 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardDefaultBorderBrush}" /> <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Style Selector="^:pointerover"> <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardDefaultBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPointeroverBackground}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource RadioButtonCardUncheckPressedBackground}" />
</Style> </Style>
<Style Selector="^:disabled"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
<Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
</Style>
</Style> </Style>
</Style> </Style>
<Style Selector="^:checked"> <Style Selector="^:checked">
<Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" /> <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckDefaultBorderBrush}" /> <Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" />
<Style Selector="^:pointerover"> <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckDefaultBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardCheckPressedBorderBrush}" />
</Style> </Style>
<Style Selector="^:disabled"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" /> <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
<Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" /> <Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" />
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
<Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
</Style>
</Style> </Style>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>