Skip to content

Commit

Permalink
fixed usage of SecondaryHueMidBrush and SecondaryHueMidForegroundBrus…
Browse files Browse the repository at this point in the history
…h resources
  • Loading branch information
spiegelp committed Mar 20, 2021
1 parent 6b1ed35 commit 79fe44b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public static void SetExtendedTheme(this ResourceDictionary resourceDictionary,
SetSolidColorBrush(resourceDictionary, "SecondaryHueDarkForegroundBrush", theme.SecondaryDark.ForegroundColor ?? theme.SecondaryDark.Color.ContrastingForegroundColor());

// these are here for backwards compatibility, and will be removed in a future version.
SetSolidColorBrush(resourceDictionary, "SecondaryAccentBrush", theme.SecondaryMid.Color);
SetSolidColorBrush(resourceDictionary, "SecondaryAccentForegroundBrush", theme.SecondaryMid.ForegroundColor ?? theme.SecondaryMid.Color.ContrastingForegroundColor());
SetSolidColorBrush(resourceDictionary, "SecondaryHueMidBrush", theme.SecondaryMid.Color);
SetSolidColorBrush(resourceDictionary, "SecondaryHueMidForegroundBrush", theme.SecondaryMid.ForegroundColor ?? theme.SecondaryMid.Color.ContrastingForegroundColor());

SetSolidColorBrush(resourceDictionary, "ValidationErrorBrush", theme.ValidationError);
resourceDictionary["ValidationErrorColor"] = theme.ValidationError;
Expand Down Expand Up @@ -89,8 +89,8 @@ public static IExtendedTheme GetExtendedTheme(this ResourceDictionary resourceDi
return theme;
}

Color secondaryMid = GetColor(resourceDictionary, "SecondaryHueMidBrush", "SecondaryAccentBrush");
Color secondaryMidForeground = GetColor(resourceDictionary, "SecondaryHueMidForegroundBrush", "SecondaryAccentForegroundBrush");
Color secondaryMid = GetColor(resourceDictionary, "SecondaryHueMidBrush", "SecondaryHueMidBrush");
Color secondaryMidForeground = GetColor(resourceDictionary, "SecondaryHueMidForegroundBrush", "SecondaryHueMidForegroundBrush");

if (!TryGetColor(resourceDictionary, "SecondaryHueLightBrush", out Color secondaryLight))
{
Expand Down
4 changes: 2 additions & 2 deletions MaterialDesignExtensions/Themes/TabControlTemplates.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@
</Style>

<Style x:Key="MaterialDesignAppBarAccentTabControl" TargetType="{x:Type TabControl}" BasedOn="{StaticResource MaterialDesignTabControl}">
<Setter Property="controls:TabControlAssist.TabHeaderHighlightBrush" Value="{DynamicResource SecondaryAccentBrush}" />
<Setter Property="controls:TabControlAssist.TabHeaderInactiveBrush" Value="{DynamicResource SecondaryAccentBrush}" />
<Setter Property="controls:TabControlAssist.TabHeaderHighlightBrush" Value="{DynamicResource SecondaryHueMidBrush}" />
<Setter Property="controls:TabControlAssist.TabHeaderInactiveBrush" Value="{DynamicResource SecondaryHueMidBrush}" />
<Setter Property="controls:TabControlAssist.TabHeaderInactiveOpacity" Value="0.8" />
<Setter Property="Background" Value="{DynamicResource PrimaryHueMidBrush}" />
</Style>
Expand Down
6 changes: 3 additions & 3 deletions MaterialDesignExtensionsDemo/Controls/AppBarControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<Canvas.RenderTransform>
<TranslateTransform X="0" Y="-161.53332"/>
</Canvas.RenderTransform>
<Rectangle Canvas.Left="5.2916665" Canvas.Top="167.35416" Width="124.35417" Height="124.35418" StrokeThickness="5.08370417" Stroke="{DynamicResource SecondaryAccentBrush}" StrokeMiterLimit="4" Opacity="1"/>
<Ellipse Canvas.Left="10" Width="114.9" Canvas.Top="172.1" Height="114.7" StrokeThickness="5.19894171" Stroke="{DynamicResource SecondaryAccentBrush}" StrokeMiterLimit="4" Opacity="1"/>
<Path StrokeThickness="5.0270834" Stroke="{DynamicResource SecondaryAccentBrush}" StrokeMiterLimit="4" StrokeLineJoin="Miter" StrokeStartLineCap="Flat" StrokeEndLineCap="Flat">
<Rectangle Canvas.Left="5.2916665" Canvas.Top="167.35416" Width="124.35417" Height="124.35418" StrokeThickness="5.08370417" Stroke="{DynamicResource SecondaryHueMidBrush}" StrokeMiterLimit="4" Opacity="1"/>
<Ellipse Canvas.Left="10" Width="114.9" Canvas.Top="172.1" Height="114.7" StrokeThickness="5.19894171" Stroke="{DynamicResource SecondaryHueMidBrush}" StrokeMiterLimit="4" Opacity="1"/>
<Path StrokeThickness="5.0270834" Stroke="{DynamicResource SecondaryHueMidBrush}" StrokeMiterLimit="4" StrokeLineJoin="Miter" StrokeStartLineCap="Flat" StrokeEndLineCap="Flat">
<Path.Data>
<PathGeometry Figures="M 23.8125 257.31249 H 111.125 L 67.733333 178.20207 Z" FillRule="NonZero"/>
</Path.Data>
Expand Down
1 change: 1 addition & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,4 @@ Please change your configuration according to [App.xaml](https://github.com/spie
* New `SearchBase.CancelIcon` and `SearchBase.ClearIcon` properties
#### Fixes
* Fixed reflection code in `ResourceDictionaryExtensions`
* Fixed usage of `SecondaryHueMidBrush` and `SecondaryHueMidForegroundBrush` resources
1 change: 1 addition & 0 deletions docs/snippets/releasenotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ <h3>Features</h3>
<h3>Fixes</h3>
<ul>
<li>Fixed exception in <code>Stepper</code> events</li>
<li>Fixed usage of <code>SecondaryHueMidBrush</code> and <code>SecondaryHueMidForegroundBrush</code> resources</li>
</ul>
<h2>v3.1.0</h2>
<h3>Features</h3>
Expand Down

0 comments on commit 79fe44b

Please sign in to comment.