Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Material.Styles/Resources/Themes/CheckBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@
<Setter Property="Opacity" Value="{StaticResource CheckBoxHoveredOpacity}" />
</Style>

<Style Selector="^:focus">
<Setter Property="FocusAdorner" Value="{x:Null}" />
</Style>

<Style Selector="^:not(:disabled):focus /template/ Ellipse#PART_HoverEffect">
<Setter Property="Opacity" Value="{StaticResource CheckBoxHoveredOpacity}" />
</Style>

<!-- Disabled state -->

<Style Selector="^:disabled">
Expand Down
43 changes: 41 additions & 2 deletions Material.Styles/Resources/Themes/RadioButton.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@
<Setter Property="Opacity" Value="{StaticResource RadioButtonHoveredOpacity}" />
</Style>

<Style Selector="^:focus">
<Setter Property="FocusAdorner" Value="{x:Null}" />
</Style>

<Style Selector="^:not(:disabled):focus /template/ Ellipse#PART_HoverEffect">
<Setter Property="Opacity" Value="{StaticResource RadioButtonHoveredOpacity}" />
</Style>

<!-- Accent -->

<Style Selector="^.accent:not(:disabled)">
Expand All @@ -127,9 +135,8 @@
BasedOn="{StaticResource MaterialRadioButton}" />


<!-- RadioButton but looks like buttons -->
<ControlTheme x:Key="MaterialButtonlikeRadioButton" TargetType="RadioButton"
BasedOn="{StaticResource {x:Type RadioButton}}">
BasedOn="{StaticResource {x:Type RadioButton}}">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialPrimaryMidBrush}" />
Expand All @@ -141,6 +148,11 @@
<ControlTemplate>
<Border Name="PART_RootBorder">
<Panel Name="PART_RootPanel">
<Border Name="PART_FocusEffect"
Opacity="0"
Background="{DynamicResource MaterialFlatButtonRippleBrush}"
IsHitTestVisible="False" />

<ripple:RippleEffect Name="PART_Ripple">
<ContentPresenter Name="PART_ContentPresenter"
BorderBrush="{TemplateBinding BorderBrush}"
Expand All @@ -165,10 +177,33 @@
<Setter Property="IsHitTestVisible" Value="False" />
</Style>

<Style Selector="^ /template/ Border#PART_FocusEffect">
<Setter Property="Opacity" Value="0" />
<Setter Property="Background" Value="{DynamicResource MaterialFlatButtonRippleBrush}" />
<Setter Property="IsHitTestVisible" Value="False" />
<Setter Property="CornerRadius" Value="2" />
</Style>

<Style Selector="^ /template/ ripple|RippleEffect#PART_Ripple">
<Setter Property="RippleFill" Value="{DynamicResource MaterialFlatButtonRippleBrush}" />
</Style>

<Style Selector="^:focus /template/ Border#PART_FocusEffect">
<Setter Property="Opacity" Value="0.12" />
</Style>

<Style Selector="^:focus:checked /template/ Border#PART_FocusEffect">
<Setter Property="Opacity" Value="0.24" />
</Style>

<Style Selector="^:not(.no-transitions) /template/ Border#PART_FocusEffect">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Property="Opacity" Duration="0.2" Easing="CircularEaseOut" />
</Transitions>
</Setter>
</Style>

<Style Selector="^:not(.no-transitions) /template/ Border#PART_BehaviourEffect">
<Setter Property="Transitions">
<Transitions>
Expand All @@ -185,5 +220,9 @@
<Setter Property="Foreground" Value="{DynamicResource MaterialSecondaryMidBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialSecondaryMidBrush}" />
</Style>

<Style Selector="^:focus">
<Setter Property="FocusAdorner" Value="{x:Null}" />
</Style>
</ControlTheme>
</ResourceDictionary>
8 changes: 8 additions & 0 deletions Material.Styles/Resources/Themes/ToggleSwitch.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@
<Setter Property="Opacity" Value="{StaticResource RippleHoveredOpacity}" />
</Style>

<Style Selector="^:focus">
<Setter Property="FocusAdorner" Value="{x:Null}" />
</Style>

<Style Selector="^:focus /template/ Ellipse#RippleThumb">
<Setter Property="Opacity" Value="{StaticResource RippleHoveredOpacity}" />
</Style>

<Style Selector="^:pressed /template/ Ellipse#RippleThumb">
<Setter Property="Opacity" Value="{StaticResource RipplePressedOpacity}" />
</Style>
Expand Down