Skip to content

Commit

Permalink
Simplify Opacity setting for chromeless button templates
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Jun 21, 2021
1 parent 51bbcb9 commit f6e9e77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/MahApps.Metro/Styles/Controls.Buttons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Opacity="0.75"
RecognizesAccessKey="{TemplateBinding mah:ControlsHelper.RecognizesAccessKey}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
Expand All @@ -251,7 +250,7 @@
<Setter TargetName="PART_ContentPresenter" Property="Opacity" Value="1" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter TargetName="PART_ContentPresenter" Property="Opacity" Value=".5" />
<Setter TargetName="PART_ContentPresenter" Property="Opacity" Value="0.5" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#ADADAD" />
Expand All @@ -261,7 +260,7 @@

<Style x:Key="MahApps.Styles.Button.Chromeless" TargetType="{x:Type ButtonBase}">
<Setter Property="Background" Value="{DynamicResource MahApps.Brushes.Transparent}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="Foreground" Value="{DynamicResource MahApps.Brushes.Text}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="0" />
<Setter Property="Template" Value="{StaticResource MahApps.Templates.Button.Chromeless}" />
Expand Down
2 changes: 1 addition & 1 deletion src/MahApps.Metro/Styles/Controls.PasswordBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<Setter TargetName="PART_ContentPresenter" Property="Opacity" Value="1" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter TargetName="PART_ContentPresenter" Property="Opacity" Value=".5" />
<Setter TargetName="PART_ContentPresenter" Property="Opacity" Value="0.5" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down
3 changes: 1 addition & 2 deletions src/MahApps.Metro/Themes/HamburgerMenuTemplate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Opacity="0.75"
RecognizesAccessKey="{TemplateBinding mah:ControlsHelper.RecognizesAccessKey}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
Expand All @@ -50,7 +49,7 @@
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter TargetName="PART_Background" Property="Opacity" Value="0" />
<Setter TargetName="PART_ContentPresenter" Property="Opacity" Value="0.75" />
<Setter TargetName="PART_ContentPresenter" Property="Opacity" Value="0.5" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#ADADAD" />
Expand Down

0 comments on commit f6e9e77

Please sign in to comment.