Skip to content

Commit

Permalink
Use fluent icons new codepoints for datepicker, timepicker, flipview,…
Browse files Browse the repository at this point in the history
… scrollbar, pipspage (#4129)

* update flip and scrollbar

* update calendarview, pipspager, loopcontrols

* pipspager
  • Loading branch information
licanhua authored Feb 17, 2021
1 parent 8d20a91 commit 33ea9b5
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 12 deletions.
5 changes: 5 additions & 0 deletions dev/CalendarView/CalendarView.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<Version>RS1</Version>
<Type>ThemeResources</Type>
</Page>
<Page Include="$(MSBuildThisFileDirectory)CalendarView_21h1_themeresources.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>21H1</Version>
<Type>ThemeResources</Type>
</Page>
<Page Include="$(MSBuildThisFileDirectory)CalendarView_themeresources_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
Expand Down
8 changes: 8 additions & 0 deletions dev/CalendarView/CalendarView_21h1_themeresources.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<x:String x:Key="CalendarViewPreviousButtonCaretUp">&#xF090;</x:String>
<x:String x:Key="CalendarViewNextButtonCaretDown">&#xF08E;</x:String>
</ResourceDictionary>
7 changes: 5 additions & 2 deletions dev/CalendarView/CalendarView_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@

<Style TargetType="CalendarView" BasedOn="{StaticResource CalendarViewRevealStyle}" />

<x:String x:Key="CalendarViewPreviousButtonCaretUp">&#xE0E4;</x:String>
<x:String x:Key="CalendarViewNextButtonCaretDown">&#xE0E5;</x:String>

<Style x:Key="CalendarViewRevealStyle" TargetType="CalendarView">
<Setter Property="FocusBorderBrush" Value="{ThemeResource CalendarViewFocusBorderBrush}" />
<Setter Property="SelectedHoverBorderBrush" Value="{ThemeResource CalendarViewSelectedHoverBorderBrush}" />
Expand Down Expand Up @@ -457,8 +460,8 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button x:Name="HeaderButton" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HeaderText}" IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HasMoreViews}" Style="{StaticResource NavigationButtonStyle}" Foreground="{TemplateBinding Foreground}" Padding="12,0,0,0" HorizontalContentAlignment="Left" />
<Button x:Name="PreviousButton" Grid.Column="1" Content="&#xE0E4;" FontFamily="{ThemeResource SymbolThemeFontFamily}" IsTabStop="True" Padding="1" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="Center" IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HasMoreContentBefore}" Style="{StaticResource NavigationButtonStyle}" />
<Button x:Name="NextButton" Grid.Column="2" Content="&#xE0E5;" FontFamily="{ThemeResource SymbolThemeFontFamily}" IsTabStop="True" Padding="1" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="Center" IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HasMoreContentAfter}" Style="{StaticResource NavigationButtonStyle}" />
<Button x:Name="PreviousButton" Grid.Column="1" Content="{ThemeResource CalendarViewPreviousButtonCaretUp}" FontFamily="{ThemeResource SymbolThemeFontFamily}" IsTabStop="True" Padding="1" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="Center" IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HasMoreContentBefore}" Style="{StaticResource NavigationButtonStyle}" />
<Button x:Name="NextButton" Grid.Column="2" Content="{ThemeResource CalendarViewNextButtonCaretDown}" FontFamily="{ThemeResource SymbolThemeFontFamily}" IsTabStop="True" Padding="1" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="Center" IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HasMoreContentAfter}" Style="{StaticResource NavigationButtonStyle}" />
</Grid>
<Grid x:Name="Views" Grid.Row="1">
<Grid.Clip>
Expand Down
8 changes: 8 additions & 0 deletions dev/CommonStyles/CommonStyles.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
<Type>ThemeResources</Type>
<Priority>1</Priority>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Common_21h1_themeresources.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>21H1</Version>
<Type>ThemeResources</Type>
<Priority>1</Priority>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Common_themeresources_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
Expand Down Expand Up @@ -141,6 +147,7 @@
<UseVisualStyle>Latest</UseVisualStyle>
<Version>21H1</Version>
<Type>ThemeResources</Type>
<RequireInsiderSDK>true</RequireInsiderSDK>
</Page>
<Page Include="$(MSBuildThisFileDirectory)ListViewItem_themeresources.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
Expand All @@ -151,6 +158,7 @@
<UseVisualStyle>Latest</UseVisualStyle>
<Version>21H1</Version>
<Type>ThemeResources</Type>
<RequireInsiderSDK>true</RequireInsiderSDK>
</Page>
<Page Include="$(MSBuildThisFileDirectory)ListViewItem_themeresources_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
Expand Down
104 changes: 104 additions & 0 deletions dev/CommonStyles/Common_21h1_themeresources.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
</ResourceDictionary>

<ResourceDictionary x:Key="Light">
</ResourceDictionary>

<ResourceDictionary x:Key="HighContrast">
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<x:String x:Key="ScrollBarCaretLeft">&#xF08D;</x:String>
<x:String x:Key="ScrollBarCaretRight">&#xF08F;</x:String>
<x:String x:Key="ScrollBarCaretUp">&#xF090;</x:String>
<x:String x:Key="ScrollBarCaretDown">&#xF08E;</x:String>

<x:String x:Key="FlipViewCaretLeft">&#xF08D;</x:String>
<x:String x:Key="FlipViewCaretRight">&#xF08F;</x:String>
<x:String x:Key="FlipViewCaretUp">&#xF090;</x:String>
<x:String x:Key="FlipViewCaretDown">&#xF08E;</x:String>

<x:String x:Key="LoopingSelectorUpButtonCaretUp">&#xF090;</x:String>
<x:String x:Key="LoopingSelectorDownButtonCaretDown">&#xF08E;</x:String>

<Style TargetType="LoopingSelector">
<Setter Property="ShouldLoop" Value="True" />
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel VerticalAlignment="Center">
<TextBlock Text="{Binding PrimaryText}" FontFamily="{ThemeResource ContentControlThemeFontFamily}" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Control">
<Grid>

<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />

<VisualState x:Name="PointerOver">

<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="UpButton" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="DownButton" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>

</VisualStateGroup>

</VisualStateManager.VisualStateGroups>
<ScrollViewer x:Name="ScrollViewer"
VerticalSnapPointsType="Mandatory"
VerticalSnapPointsAlignment="Near"
VerticalScrollBarVisibility="Hidden"
HorizontalScrollMode="Disabled"
ZoomMode="Disabled"
Template="{StaticResource ScrollViewerScrollBarlessTemplate}" />
<RepeatButton x:Name="UpButton"
Content="{ThemeResource LoopingSelectorUpButtonCaretUp}"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="8"
Height="22"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Visibility="Collapsed"
Style="{StaticResource DateTimePickerFlyoutButtonStyle}"
Background="{ThemeResource LoopingSelectorButtonBackground}"
IsTabStop="False" />
<RepeatButton x:Name="DownButton"
Content="{ThemeResource LoopingSelectorDownButtonCaretDown}"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="8"
Height="22"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Visibility="Collapsed"
Style="{StaticResource DateTimePickerFlyoutButtonStyle}"
Background="{ThemeResource LoopingSelectorButtonBackground}"
IsTabStop="False" />

</Grid>

</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
12 changes: 12 additions & 0 deletions dev/CommonStyles/Common_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,16 @@

<!-- DateTimeFlyoutBorderPadding is defined since RS5. set it here to ensure it's always defined. -->
<Thickness x:Key="DateTimeFlyoutBorderPadding">0</Thickness>

<!-- Caret/Chevron Icons -->
<x:String x:Key="ScrollBarCaretLeft">&#xE0E2;</x:String>
<x:String x:Key="ScrollBarCaretRight">&#xE0E3;</x:String>
<x:String x:Key="ScrollBarCaretUp">&#xE0E4;</x:String>
<x:String x:Key="ScrollBarCaretDown">&#xE0E5;</x:String>

<x:String x:Key="FlipViewCaretLeft">&#xE0E2;</x:String>
<x:String x:Key="FlipViewCaretRight">&#xE0E3;</x:String>
<x:String x:Key="FlipViewCaretUp">&#xE0E4;</x:String>
<x:String x:Key="FlipViewCaretDown">&#xE0E5;</x:String>

</ResourceDictionary>
8 changes: 4 additions & 4 deletions dev/FlipView/FlipView_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Foreground="{ThemeResource FlipViewNextPreviousArrowForeground}"
Glyph="&#xE0E3;"
Glyph="{ThemeResource FlipViewCaretRight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
MirroredWhenRightToLeft="True"
Expand Down Expand Up @@ -202,7 +202,7 @@
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Foreground="{ThemeResource FlipViewNextPreviousArrowForeground}"
Glyph="&#xE0E2;"
Glyph="{ThemeResource FlipViewCaretLeft}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
MirroredWhenRightToLeft="True"
Expand Down Expand Up @@ -251,7 +251,7 @@
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Foreground="{ThemeResource FlipViewNextPreviousArrowForeground}"
Glyph="&#xE0E5;"
Glyph="{ThemeResource FlipViewCaretDown}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
UseLayoutRounding="False" />
Expand Down Expand Up @@ -299,7 +299,7 @@
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Foreground="{ThemeResource FlipViewNextPreviousArrowForeground}"
Glyph="&#xE0E4;"
Glyph="{ThemeResource FlipViewCaretUp}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
UseLayoutRounding="False" />
Expand Down
5 changes: 5 additions & 0 deletions dev/PipsPager/PipsPager.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<Version>RS1</Version>
<Type>ThemeResources</Type>
</Page>
<Page Include="$(MSBuildThisFileDirectory)PipsPager_21h1_themeresources.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>21H1</Version>
<Type>ThemeResources</Type>
</Page>
<Page Include="$(MSBuildThisFileDirectory)PipsPager_themeresources_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
Expand Down
9 changes: 9 additions & 0 deletions dev/PipsPager/PipsPager_21h1_themeresources.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<x:String x:Key="PipsPagerPreviousPageButtonGlyph">&#xF090;</x:String>
<x:String x:Key="PipsPagerNextPageButtonGlyph">&#xF08E;</x:String>

</ResourceDictionary>
8 changes: 4 additions & 4 deletions dev/ScrollBar/ScrollBar_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<FontIcon x:Name="Arrow" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="&#xE0E3;" Foreground="{ThemeResource ScrollBarButtonArrowForeground}" FontSize="{StaticResource ScrollBarButtonArrowIconFontSize}" MirroredWhenRightToLeft="True" />
<FontIcon x:Name="Arrow" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="{ThemeResource ScrollBarCaretRight}" Foreground="{ThemeResource ScrollBarButtonArrowForeground}" FontSize="{StaticResource ScrollBarButtonArrowIconFontSize}" MirroredWhenRightToLeft="True" />
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
Expand Down Expand Up @@ -292,7 +292,7 @@
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<FontIcon x:Name="Arrow" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="&#xE0E2;" Foreground="{ThemeResource ScrollBarButtonArrowForeground}" FontSize="{StaticResource ScrollBarButtonArrowIconFontSize}" MirroredWhenRightToLeft="True" />
<FontIcon x:Name="Arrow" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="{ThemeResource ScrollBarCaretLeft}" Foreground="{ThemeResource ScrollBarButtonArrowForeground}" FontSize="{StaticResource ScrollBarButtonArrowIconFontSize}" MirroredWhenRightToLeft="True" />
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
Expand Down Expand Up @@ -323,7 +323,7 @@
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<FontIcon x:Name="Arrow" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="&#xE0E5;" Foreground="{ThemeResource ScrollBarButtonArrowForeground}" FontSize="{StaticResource ScrollBarButtonArrowIconFontSize}" />
<FontIcon x:Name="Arrow" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="{ThemeResource ScrollBarCaretDown}" Foreground="{ThemeResource ScrollBarButtonArrowForeground}" FontSize="{StaticResource ScrollBarButtonArrowIconFontSize}" />
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
Expand Down Expand Up @@ -354,7 +354,7 @@
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<FontIcon x:Name="Arrow" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="&#xE0E4;" Foreground="{ThemeResource ScrollBarButtonArrowForeground}" FontSize="{StaticResource ScrollBarButtonArrowIconFontSize}" />
<FontIcon x:Name="Arrow" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="{ThemeResource ScrollBarCaretUp}" Foreground="{ThemeResource ScrollBarButtonArrowForeground}" FontSize="{StaticResource ScrollBarButtonArrowIconFontSize}" />
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
Expand Down
Loading

0 comments on commit 33ea9b5

Please sign in to comment.