Skip to content

Commit

Permalink
fix(PersonPicture): Use SymbolThemeFontFamily instead of Segoe MDL2 A…
Browse files Browse the repository at this point in the history
…ssets
  • Loading branch information
kazo0 committed Feb 6, 2021
1 parent d75f094 commit e0688e3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
<VisualState x:Name="Initials" />
<VisualState x:Name="NoPhotoOrInitials">
<VisualState.Setters>
<Setter Target="InitialsTextBlock.FontFamily" Value="Segoe MDL2 Assets"/>
<Setter Target="InitialsTextBlock.FontFamily" Value="{ThemeResource SymbolThemeFontFamily}"/>
<!-- Placeholder symbol for 'Contact' (https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font) -->
<Setter Target="InitialsTextBlock.Text" Value="&#xE77B;"/>
</VisualState.Setters>
</VisualState>
<!-- Visual State when in Group mode -->
<VisualState x:Name="Group">
<VisualState.Setters>
<Setter Target="InitialsTextBlock.FontFamily" Value="Segoe MDL2 Assets"/>
<Setter Target="InitialsTextBlock.FontFamily" Value="{ThemeResource SymbolThemeFontFamily}"/>
<!-- Placeholder symbol for 'People' (https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font) -->
<Setter Target="InitialsTextBlock.Text" Value="&#xE716;"/>
</VisualState.Setters>
Expand Down
4 changes: 2 additions & 2 deletions src/Uno.UI.FluentTheme/themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17291,15 +17291,15 @@
<VisualState x:Name="Initials" />
<VisualState x:Name="NoPhotoOrInitials">
<VisualState.Setters>
<Setter Target="InitialsTextBlock.FontFamily" Value="Segoe MDL2 Assets" />
<Setter Target="InitialsTextBlock.FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
<!-- Placeholder symbol for 'Contact' (https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font) -->
<Setter Target="InitialsTextBlock.Text" Value="&#xE77B;" />
</VisualState.Setters>
</VisualState>
<!-- Visual State when in Group mode -->
<VisualState x:Name="Group">
<VisualState.Setters>
<Setter Target="InitialsTextBlock.FontFamily" Value="Segoe MDL2 Assets" />
<Setter Target="InitialsTextBlock.FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
<!-- Placeholder symbol for 'People' (https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font) -->
<Setter Target="InitialsTextBlock.Text" Value="&#xE716;" />
</VisualState.Setters>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ public async Task VerifyVSMStatesForPhotosAndInitials()
{
PersonPicture personPicture = null;
TextBlock initialsTextBlock = null;

#if WINDOWS_UWP
string symbolsFontName = "Segoe MDL2 Assets";
#elif __ANDROID__ || __SKIA__
string symbolsFontName = "ms-appx:///Assets/Fonts/uno-fluentui-assets.ttf#Symbols";
#else
string symbolsFontName = "Symbols";
#endif
await RunOnUIThread.ExecuteAsync(() =>
{
personPicture = new PersonPicture();
Expand All @@ -197,7 +203,7 @@ await RunOnUIThread.ExecuteAsync(() =>

await RunOnUIThread.ExecuteAsync(() =>
{
Verify.AreEqual(initialsTextBlock.FontFamily.Source, "Segoe MDL2 Assets");
Verify.AreEqual(initialsTextBlock.FontFamily.Source, symbolsFontName);
Verify.AreEqual(initialsTextBlock.Text, "\xE716");
personPicture.IsGroup = false;
Expand All @@ -220,7 +226,7 @@ await RunOnUIThread.ExecuteAsync(() =>

await RunOnUIThread.ExecuteAsync(() =>
{
Verify.AreEqual(initialsTextBlock.FontFamily.Source, "Segoe MDL2 Assets");
Verify.AreEqual(initialsTextBlock.FontFamily.Source, symbolsFontName);
Verify.AreEqual(initialsTextBlock.Text, "\xE77B");
// Make sure that custom FontFamily takes effect after the control is created
Expand All @@ -243,7 +249,7 @@ await RunOnUIThread.ExecuteAsync(() =>

await RunOnUIThread.ExecuteAsync(() =>
{
Verify.AreEqual(initialsTextBlock.FontFamily.Source, "Segoe MDL2 Assets");
Verify.AreEqual(initialsTextBlock.FontFamily.Source, symbolsFontName);
Verify.AreEqual(initialsTextBlock.Text, "\xE716");
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/Uno.UI/UI/Xaml/Controls/PersonPicture/PersonPicture.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
<VisualState x:Name="Initials" />
<VisualState x:Name="NoPhotoOrInitials">
<VisualState.Setters>
<Setter Target="InitialsTextBlock.FontFamily" Value="Segoe MDL2 Assets"/>
<Setter Target="InitialsTextBlock.FontFamily" Value="{ThemeResource SymbolThemeFontFamily}"/>
<!-- Placeholder symbol for 'Contact' (https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font) -->
<Setter Target="InitialsTextBlock.Text" Value="&#xE77B;"/>
</VisualState.Setters>
</VisualState>
<!-- Visual State when in Group mode -->
<VisualState x:Name="Group">
<VisualState.Setters>
<Setter Target="InitialsTextBlock.FontFamily" Value="Segoe MDL2 Assets"/>
<Setter Target="InitialsTextBlock.FontFamily" Value="{ThemeResource SymbolThemeFontFamily}"/>
<!-- Placeholder symbol for 'People' (https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font) -->
<Setter Target="InitialsTextBlock.Text" Value="&#xE716;"/>
</VisualState.Setters>
Expand Down

0 comments on commit e0688e3

Please sign in to comment.