Skip to content

Commit

Permalink
update controls to use design token colors, update styles (#3728)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranjeshj authored and karkarl committed Jan 8, 2021
1 parent 7f83c6c commit b192287
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dev/ProgressBar/ProgressBar_themeresources_v2.5.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<SolidColorBrush x:Key="ProgressBarBorderThemeBrush" Color="{ThemeResource SystemColorButtonTextColor}" />
<SolidColorBrush x:Key="ProgressBarForegroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" />
<SolidColorBrush x:Key="ProgressBarIndeterminateForegroundThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" />
<StaticResource x:Key="ProgressBarForeground" ResourceKey="SystemControlHighlightAccentBrush" />
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="ProgressBarBorderBrush" ResourceKey="SystemControlForegroundBaseHighBrush" />
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<x:Double x:Key="ProgressBarIndicatorPauseOpacity">0.6</x:Double>
Expand All @@ -46,10 +49,10 @@
<Style TargetType="ProgressBar" BasedOn="{StaticResource DefaultProgressBarStyle}" />

<Style x:Key="DefaultProgressBarStyle" TargetType="ProgressBar">
<Setter Property="Foreground" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
<Setter Property="Foreground" Value="{ThemeResource ProgressBarForeground}" />
<Setter Property="Background" Value="{ThemeResource ProgressBarBackground}" />
<Setter Property="BorderThickness" Value="{ThemeResource ProgressBarBorderThemeThickness}" />
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource ProgressBarBorderBrush}" />
<Setter Property="Maximum" Value="100" />
<Setter Property="MinHeight" Value="{ThemeResource ProgressBarThemeMinHeight}" />
<Setter Property="IsTabStop" Value="False" />
Expand Down Expand Up @@ -192,7 +195,7 @@
<VisualState x:Name="Paused">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ProgressBarIndicator" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlForegroundAccentBrush}" />
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ProgressBarForeground}" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="ProgressBarIndicator" Storyboard.TargetProperty="Opacity" To="{ThemeResource ProgressBarIndicatorPauseOpacity}" Duration="0:0:0.25" />
</Storyboard>
Expand Down
42 changes: 42 additions & 0 deletions dev/Slider/Slider_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@
<Thickness x:Key="SliderBorderThemeThickness">0</Thickness>
<Thickness x:Key="SliderHeaderThemeMargin">0,0,0,4</Thickness>
<FontWeight x:Key="SliderHeaderThemeFontWeight">Normal</FontWeight>
<StaticResource x:Key="SliderContainerBackground" ResourceKey="GhostFillColorTransparentBrush" />
<StaticResource x:Key="SliderContainerBackgroundPointerOver" ResourceKey="GhostFillColorTransparentBrush" />
<StaticResource x:Key="SliderContainerBackgroundPressed" ResourceKey="GhostFillColorTransparentBrush" />
<StaticResource x:Key="SliderContainerBackgroundDisabled" ResourceKey="GhostFillColorTransparentBrush" />
<StaticResource x:Key="SliderThumbBackground" ResourceKey="AccentAAFillColorDefaultBrush" />
<StaticResource x:Key="SliderThumbBackgroundPointerOver" ResourceKey="AccentAAFillColorSecondaryBrush" />
<StaticResource x:Key="SliderThumbBackgroundPressed" ResourceKey="AccentAAFillColorTertiaryBrush" />
<StaticResource x:Key="SliderThumbBackgroundDisabled" ResourceKey="ControlAAFillColorDisabledBrush" />
<StaticResource x:Key="SliderTrackFill" ResourceKey="ControlAltFillColorTertiaryBrush" />
<StaticResource x:Key="SliderTrackFillPointerOver" ResourceKey="ControlAltFillColorTertiaryBrush" />
<StaticResource x:Key="SliderTrackFillPressed" ResourceKey="ControlAltFillColorTertiaryBrush" />
<StaticResource x:Key="SliderTrackFillDisabled" ResourceKey="ControlAAFillColorDisabledBrush" />
<StaticResource x:Key="SliderTrackValueFill" ResourceKey="AccentAAFillColorDefaultBrush" />
<StaticResource x:Key="SliderTrackValueFillPointerOver" ResourceKey="AccentAAFillColorDefaultBrush" />
<StaticResource x:Key="SliderTrackValueFillPressed" ResourceKey="AccentAAFillColorDefaultBrush" />
<StaticResource x:Key="SliderTrackValueFillDisabled" ResourceKey="ControlAAFillColorDisabledBrush" />
<StaticResource x:Key="SliderHeaderForeground" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="SliderHeaderForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
<StaticResource x:Key="SliderTickBarFill" ResourceKey="ControlAltFillColorTertiaryBrush" />
<StaticResource x:Key="SliderTickBarFillDisabled" ResourceKey="TextFillColorDisabledBrush" />
<StaticResource x:Key="SliderInlineTickBarFill" ResourceKey="ControlFillColorInputActiveBrush" />

<!-- ColorAnimation requires TargetProperty to be Color thus some resources point to the colour instead of brush-->
<StaticResource x:Key="SliderContainerBackground" ResourceKey="ControlFillColorTransparentBrush" />
Expand Down Expand Up @@ -122,6 +143,27 @@
<Thickness x:Key="SliderBorderThemeThickness">0</Thickness>
<Thickness x:Key="SliderHeaderThemeMargin">0,0,0,4</Thickness>
<FontWeight x:Key="SliderHeaderThemeFontWeight">Normal</FontWeight>
<StaticResource x:Key="SliderContainerBackground" ResourceKey="GhostFillColorTransparentBrush" />
<StaticResource x:Key="SliderContainerBackgroundPointerOver" ResourceKey="GhostFillColorTransparentBrush" />
<StaticResource x:Key="SliderContainerBackgroundPressed" ResourceKey="GhostFillColorTransparentBrush" />
<StaticResource x:Key="SliderContainerBackgroundDisabled" ResourceKey="GhostFillColorTransparentBrush" />
<StaticResource x:Key="SliderThumbBackground" ResourceKey="AccentAAFillColorDefaultBrush" />
<StaticResource x:Key="SliderThumbBackgroundPointerOver" ResourceKey="AccentAAFillColorSecondaryBrush" />
<StaticResource x:Key="SliderThumbBackgroundPressed" ResourceKey="AccentAAFillColorTertiaryBrush" />
<StaticResource x:Key="SliderThumbBackgroundDisabled" ResourceKey="ControlAAFillColorDisabledBrush" />
<StaticResource x:Key="SliderTrackFill" ResourceKey="ControlAltFillColorTertiaryBrush" />
<StaticResource x:Key="SliderTrackFillPointerOver" ResourceKey="ControlAltFillColorTertiaryBrush" />
<StaticResource x:Key="SliderTrackFillPressed" ResourceKey="ControlAltFillColorTertiaryBrush" />
<StaticResource x:Key="SliderTrackFillDisabled" ResourceKey="ControlAAFillColorDisabledBrush" />
<StaticResource x:Key="SliderTrackValueFill" ResourceKey="AccentAAFillColorDefaultBrush" />
<StaticResource x:Key="SliderTrackValueFillPointerOver" ResourceKey="AccentAAFillColorDefaultBrush" />
<StaticResource x:Key="SliderTrackValueFillPressed" ResourceKey="AccentAAFillColorDefaultBrush" />
<StaticResource x:Key="SliderTrackValueFillDisabled" ResourceKey="ControlAAFillColorDisabledBrush" />
<StaticResource x:Key="SliderHeaderForeground" ResourceKey="TextFillColorPrimaryBrush" />
<StaticResource x:Key="SliderHeaderForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
<StaticResource x:Key="SliderTickBarFill" ResourceKey="ControlAltFillColorTertiaryBrush" />
<StaticResource x:Key="SliderTickBarFillDisabled" ResourceKey="TextFillColorDisabledBrush" />
<StaticResource x:Key="SliderInlineTickBarFill" ResourceKey="ControlFillColorInputActiveBrush" />

<!-- ColorAnimation requires TargetProperty to be Color thus some resources point to the colour instead of brush-->
<StaticResource x:Key="SliderContainerBackground" ResourceKey="ControlFillColorTransparentBrush" />
Expand Down

0 comments on commit b192287

Please sign in to comment.