Skip to content

Commit 5263d0d

Browse files
corvinszKeboo
andauthored
Enhance Mouseover Visuals for RadioButton (#3970)
* add halo when hovering over a RadioButton * Adjusts halo ellipse size Changes halo ellipse dimensions from 25x25 to 22x22. I think this size is a bit closer to what the spec shows. --------- Co-authored-by: Kevin Bost <[email protected]>
1 parent 20414e4 commit 5263d0d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ToggleButton.xaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@
327327
<Style x:Key="MaterialDesignSwitchToggleButton" TargetType="{x:Type ToggleButton}">
328328
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
329329
<Setter Property="BorderThickness" Value="1" />
330+
<Setter Property="Cursor" Value="Hand" />
330331
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
331332
<Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Foreground}" />
332333
<Setter Property="Padding" Value="0,1,0,0" />
@@ -438,6 +439,20 @@
438439
<ScaleTransform ScaleX="1" ScaleY="1" />
439440
</Ellipse.RenderTransform>
440441
</Ellipse>
442+
<Ellipse x:Name="halo"
443+
Width="22"
444+
Height="22"
445+
Margin="0"
446+
HorizontalAlignment="Center"
447+
VerticalAlignment="Center"
448+
Fill="{DynamicResource MaterialDesign.Brush.Primary.Light}"
449+
IsHitTestVisible="False"
450+
Opacity="0"
451+
RenderTransformOrigin="0.5,0.5">
452+
<Ellipse.RenderTransform>
453+
<ScaleTransform ScaleX="2.5" ScaleY="2.5" />
454+
</Ellipse.RenderTransform>
455+
</Ellipse>
441456
<AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}">
442457
<Ellipse x:Name="Thumb"
443458
Width="25"
@@ -499,6 +514,9 @@
499514
</Setter.Value>
500515
</Setter>
501516
</Trigger>
517+
<Trigger Property="IsMouseOver" Value="True">
518+
<Setter TargetName="halo" Property="Opacity" Value="{x:Static wpf:Constants.InteractionHoverOpacity}" />
519+
</Trigger>
502520
</ControlTemplate.Triggers>
503521
</ControlTemplate>
504522
</Setter.Value>

0 commit comments

Comments
 (0)