Skip to content

Commit

Permalink
Fix font references in UWP and WinUI (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotMorten authored Nov 14, 2024
1 parent 99db864 commit f6107fc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</Page>
<Content Include="$(MSBuildThisFileDirectory)..\Toolkit.WinUI\Assets\**\*.*" Link="Assets\%(RecursiveDir)%(Filename)%(Extension)" />
<Compile Include="$(MSBuildThisFileDirectory)..\Toolkit.WinUI\**\*.cs" Exclude="$(MSBuildThisFileDirectory)..\Toolkit.WinUI\obj\**\*.*" Link="%(RecursiveDir)%(Filename)%(Extension)" />
<Page Include="$(MSBuildThisFileDirectory)..\Toolkit.WinUI\**\*.xaml" Exclude="$(MSBuildThisFileDirectory)..\Toolkit.WinUI\obj\**\*.*;$(MSBuildThisFileDirectory)..\Toolkit.WinUI\bin\**\*.*;$(MSBuildThisFileDirectory)..\Toolkit.WinUI\Themes\Generic.xaml;$(MSBuildThisFileDirectory)..\Toolkit.WinUI\UI\Controls\**\*.Resources.xaml;$(MSBuildThisFileDirectory)..\Toolkit.WinUI\**\*.WinUI.xaml">
<Page Include="$(MSBuildThisFileDirectory)..\Toolkit.WinUI\**\*.xaml" Exclude="$(MSBuildThisFileDirectory)..\Toolkit.WinUI\obj\**\*.*;$(MSBuildThisFileDirectory)..\Toolkit.WinUI\bin\**\*.*;$(MSBuildThisFileDirectory)..\Toolkit.WinUI\Themes\*.xaml;$(MSBuildThisFileDirectory)..\Toolkit.WinUI\UI\Controls\**\*.Resources.xaml;$(MSBuildThisFileDirectory)..\Toolkit.WinUI\**\*.WinUI.xaml">
<Generator>MSBuild:Compile</Generator>
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
</Page>
Expand Down
5 changes: 5 additions & 0 deletions src/Toolkit/Toolkit.UWP/Themes/SharedResources.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<FontFamily x:Key="calcite-ui-icons-24">ms-appx:///Esri.ArcGISRuntime.Toolkit.UWP/Assets/calcite-ui-icons-24.ttf#calcite-ui-icons-24</FontFamily>
</ResourceDictionary>
5 changes: 5 additions & 0 deletions src/Toolkit/Toolkit.WinUI/Themes/SharedResources.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<FontFamily x:Key="calcite-ui-icons-24">ms-appx:///Esri.ArcGISRuntime.Toolkit.WinUI/Assets/calcite-ui-icons-24.ttf#calcite-ui-icons-24</FontFamily>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:basemapgallery="using:Esri.ArcGISRuntime.Toolkit.UI.Controls"
xmlns:controls="using:Esri.ArcGISRuntime.Toolkit.UI.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../../Themes/SharedResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="ItemTextForegroundUnselected" Color="#6a6a6a" />
Expand Down Expand Up @@ -144,7 +147,7 @@
BorderBrush="#4d6e6e6e"
BorderThickness="1">
<Grid>
<FontIcon FontFamily="calcite-ui-icons-24" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE032;" />
<FontIcon FontFamily="{StaticResource calcite-ui-icons-24}" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE032;" />
<Image
Width="62"
Height="62"
Expand Down Expand Up @@ -184,7 +187,7 @@
BorderBrush="#4d6e6e6e"
BorderThickness="1">
<Grid>
<FontIcon FontFamily="calcite-ui-icons-24" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE032;" />
<FontIcon FontFamily="{StaticResource calcite-ui-icons-24}" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE032;" />
<Image
Width="62"
Height="62"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Esri.ArcGISRuntime.Toolkit.UI.Controls">

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../../Themes/SharedResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="controls:MeasureToolbar">
<Setter Property="Background"
Value="{ThemeResource ComboBoxBackground}" />
Expand Down Expand Up @@ -43,7 +47,7 @@
VerticalContentAlignment="Center"
ToolTipService.ToolTip="Length">
<ToggleButton.Content>
<FontIcon FontFamily="calcite-ui-icons-24" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE1C6;" />
<FontIcon FontFamily="{StaticResource calcite-ui-icons-24}" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE1C6;" />
</ToggleButton.Content>
</ToggleButton>
<ToggleButton x:Name="MeasureArea"
Expand All @@ -54,7 +58,7 @@
ToolTipService.ToolTip="Area"
Grid.Column="1">
<ToggleButton.Content>
<FontIcon FontFamily="calcite-ui-icons-24" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE1C2;" />
<FontIcon FontFamily="{StaticResource calcite-ui-icons-24}" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE1C2;" />
</ToggleButton.Content>
</ToggleButton>
<ToggleButton x:Name="MeasureFeature"
Expand All @@ -65,7 +69,7 @@
ToolTipService.ToolTip="Feature"
Grid.Column="2">
<ToggleButton.Content>
<FontIcon FontFamily="calcite-ui-icons-24" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE1C7;" />
<FontIcon FontFamily="{StaticResource calcite-ui-icons-24}" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="&#xE1C7;" />
</ToggleButton.Content>
</ToggleButton>
<Border Background="{TemplateBinding Background}"
Expand Down

0 comments on commit f6107fc

Please sign in to comment.