committed by
Dan Walmsley
5 changed files with 273 additions and 61 deletions
@ -1,60 +1,102 @@ |
|||||
<Styles xmlns="https://github.com/avaloniaui"> |
<Styles xmlns="https://github.com/avaloniaui"> |
||||
<Style Selector="RadioButton"> |
<Style Selector="RadioButton"> |
||||
<Setter Property="Background" Value="Transparent"/> |
<Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" /> |
||||
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> |
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" /> |
||||
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> |
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrush}" /> |
||||
|
<Setter Property="Padding" Value="8,6,0,0" /> |
||||
|
<Setter Property="HorizontalAlignment" Value="Left" /> |
||||
|
<Setter Property="VerticalAlignment" Value="Center" /> |
||||
|
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
||||
|
<Setter Property="VerticalContentAlignment" Value="Top" /> |
||||
|
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
||||
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
||||
|
<Setter Property="MinWidth" Value="120" /> |
||||
<Setter Property="Template"> |
<Setter Property="Template"> |
||||
<ControlTemplate> |
<ControlTemplate TargetType="RadioButton"> |
||||
<Grid ColumnDefinitions="Auto,*" Background="{TemplateBinding Background}"> |
<Border Name="RootBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{DynamicResource ControlCornerRadius}"> |
||||
<Ellipse Name="border" |
<Grid ColumnDefinitions="20,*"> |
||||
Stroke="{TemplateBinding BorderBrush}" |
<Grid VerticalAlignment="Top" Height="32"> |
||||
StrokeThickness="1" |
<Ellipse Name="OuterEllipse" Width="20" Height="20" UseLayoutRounding="False" Stroke="{DynamicResource RadioButtonOuterEllipseStroke}" Fill="{StaticResource RadioButtonOuterEllipseFill}" |
||||
Width="18" |
StrokeThickness="{DynamicResource RadioButtonBorderThemeThickness}" /> |
||||
Height="18" |
<Ellipse Name="CheckOuterEllipse" Width="20" Height="20" UseLayoutRounding="False" Stroke="{DynamicResource RadioButtonOuterEllipseCheckedStroke}" Fill="{DynamicResource RadioButtonOuterEllipseCheckedFill}" Opacity="0" |
||||
VerticalAlignment="Center"/> |
StrokeThickness="{DynamicResource RadioButtonBorderThemeThickness}" /> |
||||
<Ellipse Name="checkMark" |
<Ellipse Name="CheckGlyph" Width="8" Height="8" UseLayoutRounding="False" Opacity="0" Fill="{DynamicResource RadioButtonCheckGlyphFill}" Stroke="{DynamicResource RadioButtonCheckGlyphStroke}" /> |
||||
Width="10" |
</Grid> |
||||
Height="10" |
<ContentPresenter Name="PART_ContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" TextBlock.Foreground="{TemplateBinding Foreground}" Margin="{TemplateBinding Padding}" |
||||
Stretch="Uniform" |
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" /> |
||||
UseLayoutRounding="False" |
</Grid> |
||||
HorizontalAlignment="Center" |
</Border> |
||||
VerticalAlignment="Center"/> |
|
||||
<Ellipse Name="indeterminateMark" |
|
||||
Fill="{DynamicResource ThemeAccentBrush}" |
|
||||
Width="10" |
|
||||
Height="10" |
|
||||
Stretch="Uniform" |
|
||||
UseLayoutRounding="False" |
|
||||
HorizontalAlignment="Center" |
|
||||
VerticalAlignment="Center"/> |
|
||||
<ContentPresenter Name="PART_ContentPresenter" |
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|
||||
Content="{TemplateBinding Content}" |
|
||||
Margin="4,0,0,0" |
|
||||
VerticalAlignment="Center" |
|
||||
Grid.Column="1"/> |
|
||||
</Grid> |
|
||||
</ControlTemplate> |
</ControlTemplate> |
||||
</Setter> |
</Setter> |
||||
</Style> |
</Style> |
||||
|
<!-- PointerOver State --> |
||||
<Style Selector="RadioButton:pointerover /template/ Ellipse#border"> |
<Style Selector="RadioButton:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
||||
<Setter Property="Stroke" Value="{DynamicResource ThemeBorderHighBrush}"/> |
<Setter Property="(TextBlock.Foreground)" Value="{DynamicResource RadioButtonForegroundPointerOver}" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="RadioButton /template/ Ellipse#checkMark"> |
<Style Selector="RadioButton:pointerover /template/ Border#RootBorder"> |
||||
<Setter Property="Fill" Value="{DynamicResource HighlightBrush}"/> |
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundPointerOver}" /> |
||||
<Setter Property="IsVisible" Value="False"/> |
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushPointerOver}" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="RadioButton /template/ Ellipse#indeterminateMark"> |
<Style Selector="RadioButton:pointerover /template/ Ellipse#OuterEllipse"> |
||||
<Setter Property="IsVisible" Value="False"/> |
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokePointerOver}" /> |
||||
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillPointerOver}" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="RadioButton:checked /template/ Ellipse#checkMark"> |
<Style Selector="RadioButton:pointerover /template/ Ellipse#CheckOuterEllipse"> |
||||
<Setter Property="IsVisible" Value="True"/> |
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokePointerOver}" /> |
||||
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillPointerOver}" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="RadioButton:indeterminate /template/ Ellipse#indeterminateMark"> |
<Style Selector="RadioButton:pointerover /template/ Ellipse#CheckGlyph"> |
||||
<Setter Property="IsVisible" Value="True"/> |
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphFillPointerOver}" /> |
||||
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphStrokePointerOver}" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="RadioButton:disabled /template/ Ellipse#border"> |
<!-- Pressed State --> |
||||
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}"/> |
<Style Selector="RadioButton:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
||||
|
<Setter Property="(TextBlock.Foreground)" Value="{DynamicResource RadioButtonForegroundPressed}" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:pressed /template/ Border#RootBorder"> |
||||
|
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundPressed}" /> |
||||
|
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushPressed}" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:pressed /template/ Ellipse#OuterEllipse"> |
||||
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokePressed}" /> |
||||
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillPressed}" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:pressed /template/ Ellipse#CheckOuterEllipse"> |
||||
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokePressed}" /> |
||||
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillPressed}" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:pressed /template/ Ellipse#CheckGlyph"> |
||||
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphFillPressed}" /> |
||||
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphStrokePressed}" /> |
||||
|
</Style> |
||||
|
<!-- Disabled State --> |
||||
|
<Style Selector="RadioButton:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
||||
|
<Setter Property="(TextBlock.Foreground)" Value="{DynamicResource RadioButtonForegroundDisabled}" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:disabled /template/ Border#RootBorder"> |
||||
|
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundDisabled}" /> |
||||
|
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushDisabled}" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:disabled /template/ Ellipse#OuterEllipse"> |
||||
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokeDisabled}" /> |
||||
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillDisabled}" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:disabled /template/ Ellipse#CheckOuterEllipse"> |
||||
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokeDisabled}" /> |
||||
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillDisabled}" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:disabled /template/ Ellipse#CheckGlyph"> |
||||
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphFillDisabled}" /> |
||||
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphStrokeDisabled}" /> |
||||
|
</Style> |
||||
|
<!-- Checked State --> |
||||
|
<Style Selector="RadioButton:checked /template/ Ellipse#CheckGlyph"> |
||||
|
<Setter Property="Opacity" Value="1" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:checked /template/ Ellipse#OuterEllipse"> |
||||
|
<Setter Property="Opacity" Value="0" /> |
||||
|
</Style> |
||||
|
<Style Selector="RadioButton:checked /template/ Ellipse#CheckOuterEllipse"> |
||||
|
<Setter Property="Opacity" Value="1" /> |
||||
</Style> |
</Style> |
||||
</Styles> |
</Styles> |
||||
|
|||||
Loading…
Reference in new issue