Skip to content

Commit

Permalink
Add key names to default control styles (#1300)
Browse files Browse the repository at this point in the history
* Add name to default control styles

* Fix indentation

* Fix test failure

* Update dev/Pivot/Pivot_themeresources.xaml

Co-Authored-By: Chris Glein <[email protected]>

* Update dev/Pivot/Pivot_themeresources.xaml

Co-Authored-By: Chris Glein <[email protected]>
  • Loading branch information
2 people authored and jevansaks committed Sep 11, 2019
1 parent 6007851 commit 63c8ddb
Show file tree
Hide file tree
Showing 50 changed files with 237 additions and 124 deletions.
4 changes: 3 additions & 1 deletion dev/AutoSuggestBox/AutoSuggestBox_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@
</Setter>
</Style>

<Style TargetType="AutoSuggestBox">
<Style TargetType="AutoSuggestBox" BasedOn="{StaticResource DefaultAutoSuggestBoxStyle}" />

<Style x:Key="DefaultAutoSuggestBoxStyle" TargetType="AutoSuggestBox">
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="TextBoxStyle" Value="{StaticResource AutoSuggestBoxTextBoxStyle}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="CalendarDatePicker">
<Style TargetType="CalendarDatePicker" BasedOn="{StaticResource DefaultCalendarDatePicker}" />

<Style x:Key="DefaultCalendarDatePicker" TargetType="CalendarDatePicker">
<Setter Property="Foreground" Value="{ThemeResource CalendarDatePickerForeground}" />
<Setter Property="Background" Value="{ThemeResource CalendarDatePickerBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource CalendarDatePickerBorderBrush}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CheckBox/CheckBox_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="CheckBox">
<Style TargetType="CheckBox" BasedOn="{StaticResource DefaultCheckBoxStyle}" />

<Style x:Key="DefaultCheckBoxStyle" TargetType="CheckBox">
<Setter Property="Background" Value="{ThemeResource CheckBoxBackgroundUnchecked}" />
<Setter Property="Foreground" Value="{ThemeResource CheckBoxForegroundUnchecked}" />
<Setter Property="BorderBrush" Value="{ThemeResource CheckBoxBorderBrushUnchecked}" />
Expand Down
5 changes: 4 additions & 1 deletion dev/ColorPicker/ColorPicker.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
xmlns:primitives="using:Microsoft.UI.Xaml.Controls.Primitives"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)">
<Style TargetType="controls:ColorPicker" >

<Style TargetType="controls:ColorPicker" BasedOn="{StaticResource DefaultColorPickerStyle}"/>

<Style x:Key="DefaultColorPickerStyle" TargetType="controls:ColorPicker">
<Setter Property="MaxWidth" Value="392" />
<Setter Property="MinWidth" Value="312" />
<Setter Property="IsTabStop" Value="False" />
Expand Down
4 changes: 3 additions & 1 deletion dev/ComboBox/ComboBox_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@
<Thickness x:Key="ComboBoxEditableTextPadding">11,5,32,6</Thickness>
<Thickness x:Key="ComboBoxMinHeight">32</Thickness>

<Style TargetType="ComboBox">
<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}"/>

<Style x:Key="DefaultComboBoxStyle" TargetType="ComboBox">
<Setter Property="Padding" Value="{ThemeResource ComboBoxPadding}" />
<Setter Property="MaxDropDownHeight" Value="504" />
<Setter Property="Foreground" Value="{ThemeResource ComboBoxForeground}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommandBarFlyout/CommandBarFlyout.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)">

<Style TargetType="local:CommandBarFlyoutCommandBar">
<Style x:Key="DefaultCommandBarFlyoutCommandBarStyle" TargetType="local:CommandBarFlyoutCommandBar">
<Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}" />
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlTransientBorderBrush}" />
Expand Down Expand Up @@ -448,4 +448,6 @@
</Setter.Value>
</Setter>
</Style>

<Style TargetType="local:CommandBarFlyoutCommandBar" BasedOn="{StaticResource DefaultCommandBarFlyoutCommandBarStyle}"/>
</ResourceDictionary>
4 changes: 3 additions & 1 deletion dev/CommonStyles/AppBarButton_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@
<Thickness x:Key="AppBarButtonTextLabelMargin">2,0,2,8</Thickness>
<Thickness x:Key="AppBarButtonTextLabelOnRightMargin">8,11,12,13</Thickness>

<Style TargetType="AppBarButton" BasedOn="{StaticResource DefaultAppBarButtonStyle}" />

<!-- LabelOnRightStyle is retired since RS3, We still need it for RS2 or RS3 -->
<Style TargetType="AppBarButton">
<Style x:Key="DefaultAppBarButtonStyle" TargetType="AppBarButton">
<Setter Property="Background" Value="{ThemeResource AppBarButtonBackground}" />
<Setter Property="Foreground" Value="{ThemeResource AppBarButtonForeground}" />
<Setter Property="BorderBrush" Value="{ThemeResource AppBarButtonBorderBrush}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/AppBarToggleButton_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@
<Thickness x:Key="AppBarToggleButtonTextLabelOnRightMargin">8,11,12,13</Thickness>
<Thickness x:Key="AppBarToggleButtonOverflowTextLabelPadding">0,5,0,8</Thickness>

<Style TargetType="AppBarToggleButton" BasedOn="{StaticResource DefaultAppBarToggleButtonStyle}" />

<!-- LabelOnRightStyle is retired since RS3, We still need it for RS2 or RS3 -->
<Style TargetType="AppBarToggleButton">
<Style x:Key="DefaultAppBarToggleButtonStyle" TargetType="AppBarToggleButton">
<Setter Property="Background" Value="{ThemeResource AppBarToggleButtonBackground}" />
<Setter Property="Foreground" Value="{ThemeResource AppBarToggleButtonForeground}" />
<Setter Property="BorderBrush" Value="{ThemeResource AppBarToggleButtonBorderBrush}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/Button_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@

<Thickness x:Key="ButtonPadding">8,5,8,6</Thickness>

<Style TargetType="Button">
<Style TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}" />

<Style x:Key="DefaultButtonStyle" TargetType="Button">
<Setter Property="Background" Value="{ThemeResource ButtonBackground}" />
<contract7Present:Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="Foreground" Value="{ThemeResource ButtonForeground}" />
Expand Down
8 changes: 6 additions & 2 deletions dev/CommonStyles/CommandBar_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@

<Thickness x:Key="CommandBarOverflowPresenterMargin">0,4,0,4</Thickness>

<Style TargetType="CommandBar">
<Style TargetType="CommandBar" BasedOn="{StaticResource DefaultCommandBarStyle}" />

<Style x:Key="DefaultCommandBarStyle" TargetType="CommandBar">
<Setter Property="Background" Value="{ThemeResource CommandBarBackground}" />
<Setter Property="Foreground" Value="{ThemeResource CommandBarForeground}" />
<Setter Property="IsTabStop" Value="False" />
Expand Down Expand Up @@ -901,7 +903,9 @@
</Setter>
</Style>

<Style TargetType="CommandBarOverflowPresenter">
<Style TargetType="CommandBarOverflowPresenter" BasedOn="{StaticResource DefaultCommandBarOverflowPresenterStyle}" />

<Style x:Key="DefaultCommandBarOverflowPresenterStyle" TargetType="CommandBarOverflowPresenter">
<Setter Property="Background" Value="{ThemeResource CommandBarOverflowPresenterBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource CommandBarOverflowPresenterBorderBrush}" />
<Setter Property="Padding" Value="{ThemeResource CommandBarOverflowPresenterBorderPadding}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/FlyoutPresenter_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
<Thickness x:Key="FlyoutBorderThemePadding">0</Thickness>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="FlyoutPresenter" BasedOn="{StaticResource DefaultFlyoutPresenterStyle}" />

<Style TargetType="FlyoutPresenter">
<Style x:Key="DefaultFlyoutPresenterStyle" TargetType="FlyoutPresenter">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="IsTabStop" Value="False" />
Expand Down
8 changes: 6 additions & 2 deletions dev/CommonStyles/ListBox_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@

<Thickness x:Key="ListBoxItemPadding">12,9,12,12</Thickness>

<Style TargetType="ListBoxItem">
<Style TargetType="ListBoxItem" BasedOn="{StaticResource DefaultListBoxItemStyle}" />

<Style x:Key="DefaultListBoxItemStyle" TargetType="ListBoxItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="TabNavigation" Value="Local" />
<Setter Property="Padding" Value="{StaticResource ListBoxItemPadding}" />
Expand Down Expand Up @@ -190,7 +192,9 @@
</Setter>
</Style>

<Style TargetType="ListBox">
<Style TargetType="ListBox" BasedOn="{StaticResource DefaultListBoxStyle}" />

<Style x:Key="DefaultListBoxStyle" TargetType="ListBox">
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/ListViewItem_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="ListViewItem">
<Style TargetType="ListViewItem" BasedOn="{StaticResource DefaultListViewItemStyle}" />

<Style x:Key="DefaultListViewItemStyle" TargetType="ListViewItem">
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="Background" Value="{ThemeResource ListViewItemBackground}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/MediaTransportControls_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="MediaTransportControls">
<Style TargetType="MediaTransportControls" BasedOn="{StaticResource DefaultMediaTransportControlsStyle}" />

<Style x:Key="DefaultMediaTransportControlsStyle" TargetType="MediaTransportControls">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="FlowDirection" Value="LeftToRight" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/PasswordBox_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

<Thickness x:Key="PasswordBoxTopHeaderMargin">0,0,0,4</Thickness>

<Style TargetType="PasswordBox">
<Style TargetType="PasswordBox" BasedOn="{StaticResource DefaultPasswordBoxStyle}" />

<Style x:Key="DefaultPasswordBoxStyle" TargetType="PasswordBox">
<Setter Property="Foreground" Value="{ThemeResource TextControlForeground}" />
<Setter Property="Background" Value="{ThemeResource TextControlBackground}" />
<Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/ProgressBar_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="ProgressBar">
<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="BorderThickness" Value="{ThemeResource ProgressBarBorderThemeThickness}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/RepeatButton_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="RepeatButton">
<Style TargetType="RepeatButton" BasedOn="{StaticResource DefaultRepeatButtonStyle}" />

<Style x:Key="DefaultRepeatButtonStyle" TargetType="RepeatButton">
<Setter Property="Background" Value="{ThemeResource RepeatButtonBackground}" />
<contract7Present:Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="Foreground" Value="{ThemeResource RepeatButtonForeground}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/RichEditBox_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

<Thickness x:Key="RichEditBoxTopHeaderMargin">0,0,0,4</Thickness>

<Style TargetType="RichEditBox">
<Style TargetType="RichEditBox" BasedOn="{StaticResource DefaultRichEditBoxStyle}" />

<Style x:Key="DefaultRichEditBoxStyle" TargetType="RichEditBox">
<Setter Property="Foreground" Value="{ThemeResource TextControlForeground}" />
<Setter Property="Background" Value="{ThemeResource TextControlBackground}" />
<contract7Present:Setter Property="ContentLinkForegroundColor" Value="{ThemeResource ContentLinkForegroundColor}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/TextBox_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@

<Thickness x:Key="TextBoxTopHeaderMargin">0,0,0,4</Thickness>

<Style TargetType="TextBox">
<Style TargetType="TextBox" BasedOn="{StaticResource DefaultTextBoxStyle}" />

<Style x:Key="DefaultTextBoxStyle" TargetType="TextBox">
<Setter Property="Foreground" Value="{ThemeResource TextControlForeground}" />
<Setter Property="Background" Value="{ThemeResource TextControlBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/ToggleButton_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="ToggleButton">
<Style TargetType="ToggleButton" BasedOn="{StaticResource DefaultToggleButtonStyle}" />

<Style x:Key="DefaultToggleButtonStyle" TargetType="ToggleButton">
<Setter Property="Background" Value="{ThemeResource ToggleButtonBackground}" />
<contract7Present:Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="Foreground" Value="{ThemeResource ToggleButtonForeground}" />
Expand Down
4 changes: 3 additions & 1 deletion dev/CommonStyles/ToggleSwitch_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@

<x:Double x:Key="ToggleSwitchThemeMinWidth">154</x:Double>

<Style TargetType="ToggleSwitch">
<Style TargetType="ToggleSwitch" BasedOn="{StaticResource DefaultToggleSwitchStyle}" />

<Style x:Key="DefaultToggleSwitchStyle" TargetType="ToggleSwitch">
<Setter Property="Foreground" Value="{ThemeResource ToggleSwitchContentForeground}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
Expand Down
4 changes: 3 additions & 1 deletion dev/ContentDialog/ContentDialog_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="ContentDialog">
<Style TargetType="ContentDialog" BasedOn="{StaticResource DefaultContentDialogStyle}" />

<Style x:Key="DefaultContentDialogStyle" TargetType="ContentDialog">
<Setter Property="Foreground" Value="{ThemeResource ContentDialogForeground}" />
<Setter Property="Background" Value="{ThemeResource ContentDialogBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ContentDialogBorderBrush}" />
Expand Down
8 changes: 6 additions & 2 deletions dev/DatePicker/DatePicker_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@
<Thickness x:Key="DatePickerHostPadding">0,3,0,6</Thickness>
<Thickness x:Key="DatePickerHostMonthPadding">9,3,0,6</Thickness>

<Style TargetType="DatePicker">
<Style TargetType="DatePicker" BasedOn="{StaticResource DefaultDatePickerStyle}" />

<Style x:Key="DefaultDatePickerStyle" TargetType="DatePicker">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
Expand Down Expand Up @@ -350,7 +352,9 @@
</Setter>
</Style>

<Style TargetType="DatePickerFlyoutPresenter">
<Style TargetType="DatePickerFlyoutPresenter" BasedOn="{StaticResource DefaultDatePickerFlyoutPresenterStyle}" />

<Style x:Key="DefaultDatePickerFlyoutPresenterStyle" TargetType="DatePickerFlyoutPresenter">
<Setter Property="Width" Value="296" />
<Setter Property="MinWidth" Value="296" />
<Setter Property="MaxHeight" Value="398" />
Expand Down
4 changes: 3 additions & 1 deletion dev/DropDownButton/DropDownButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)">

<Style TargetType="local:DropDownButton">
<Style x:Key="DefaultDropDownButtonStyle" TargetType="local:DropDownButton">
<Setter Property="Background" Value="{ThemeResource ButtonBackground}" />
<Setter Property="Foreground" Value="{ThemeResource ButtonForeground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ButtonBorderBrush}" />
Expand Down Expand Up @@ -119,4 +119,6 @@
</Setter>
</Style>

<Style TargetType="local:DropDownButton" BasedOn="{StaticResource DefaultDropDownButtonStyle}" />

</ResourceDictionary>
4 changes: 3 additions & 1 deletion dev/DropDownButton/DropDownButton_rs1.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)">

<Style TargetType="local:DropDownButton">
<Style x:Key="DefaultDropDownButtonStyle" TargetType="local:DropDownButton">
<Setter Property="Background" Value="{ThemeResource ButtonBackground}" />
<Setter Property="Foreground" Value="{ThemeResource ButtonForeground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ButtonBorderBrush}" />
Expand Down Expand Up @@ -118,4 +118,6 @@
</Setter>
</Style>

<Style TargetType="local:DropDownButton" BasedOn="{StaticResource DefaultDropDownButtonStyle}" />

</ResourceDictionary>
4 changes: 3 additions & 1 deletion dev/FlipView/FlipViewItem_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<Style TargetType="FlipViewItem">
<Style TargetType="FlipViewItem" BasedOn="{StaticResource DefaultFlipViewItemStyle}" />

<Style x:Key="DefaultFlipViewItemStyle" TargetType="FlipViewItem">
<Setter Property="Background" Value="{ThemeResource FlipViewItemBackground}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
Expand Down
Loading

0 comments on commit 63c8ddb

Please sign in to comment.