Skip to content

Commit

Permalink
chore: remove MaterialFontsOverride.xaml
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Oct 4, 2023
1 parent abd9200 commit b4336ce
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 22 deletions.
54 changes: 54 additions & 0 deletions src/Uno.Templates/content/unoapp/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,60 @@
]
}
},
"toolkitMaterialStyleNamespace": {
"type": "generated",
"generator": "switch",
"replaces": "$toolkitMaterialStyleNamespace$",
"parameters": {
"evaluator": "C++",
"cases": [
{
"condition": "(useToolkit)",
"value": "\n xmlns:utum=\"using:Uno.Toolkit.UI.Material\""
},
{
"condition": "true",
"value": ""
}
]
}
},
"materialStyleNamespace": {
"type": "generated",
"generator": "switch",
"replaces": "$materialStyleNamespace$",
"parameters": {
"evaluator": "C++",
"cases": [
{
"condition": "(useMaterial)",
"value": "\n xmlns:um=\"using:Uno.Material\""
},
{
"condition": "true",
"value": ""
}
]
}
},
"cupertinoStyleNamespace": {
"type": "generated",
"generator": "switch",
"replaces": "$cupertinoStyleNamespace$",
"parameters": {
"evaluator": "C++",
"cases": [
{
"condition": "(useMaterial)",
"value": "\n xmlns:uc=\"using:Uno.Cupertino\""
},
{
"condition": "true",
"value": ""
}
]
}
},
"toolkitSafeArea": {
"type": "generated",
"generator": "switch",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"$materialStyleNamespace$$toolkitMaterialStyleNamespace$$cupertinoStyleNamespace$>

<ResourceDictionary.MergedDictionaries>
<!-- Load WinUI resources -->
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!--#if (useMaterial)-->
<!--#if (useToolkit)-->
<MaterialToolkitTheme xmlns="using:Uno.Toolkit.UI.Material"
ColorOverrideSource="ms-appx:///MyExtensionsApp._1/Styles/ColorPaletteOverride.xaml"
FontOverrideSource="ms-appx:///MyExtensionsApp._1/Styles/MaterialFontsOverride.xaml" />
<utum:MaterialToolkitTheme xmlns="using:Uno.Toolkit.UI.Material"
ColorOverrideSource="ms-appx:///MyExtensionsApp._1/Styles/ColorPaletteOverride.xaml">
<!-- NOTE: You can override the default Roboto font by providing your font assets here. -->
<!-- <utum:MaterialToolkitTheme.FontOverrideDictionary>
<ResourceDictionary>
<FontFamily x:Key="MaterialLightFontFamily">ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf#Roboto</FontFamily>
<FontFamily x:Key="MaterialMediumFontFamily">ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf#Roboto</FontFamily>
<FontFamily x:Key="MaterialRegularFontFamily">ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf#Roboto</FontFamily>
</ResourceDictionary>
</utum:MaterialToolkitTheme.FontOverrideDictionary> -->
</utum:MaterialToolkitTheme>
<!--#else-->
<MaterialTheme xmlns="using:Uno.Material"
ColorOverrideSource="ms-appx:///MyExtensionsApp._1/Styles/ColorPaletteOverride.xaml"
FontOverrideSource="ms-appx:///MyExtensionsApp._1/Styles/MaterialFontsOverride.xaml" />
<um:MaterialTheme xmlns="using:Uno.Material"
ColorOverrideSource="ms-appx:///MyExtensionsApp._1/Styles/ColorPaletteOverride.xaml">
<!-- NOTE: You can override the default Roboto font by providing your font assets here. -->
<!-- <um:MaterialTheme.FontOverrideDictionary>
<ResourceDictionary>
<FontFamily x:Key="MaterialLightFontFamily">ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf#Roboto</FontFamily>
<FontFamily x:Key="MaterialMediumFontFamily">ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf#Roboto</FontFamily>
<FontFamily x:Key="MaterialRegularFontFamily">ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf#Roboto</FontFamily>
</ResourceDictionary>
</um:MaterialTheme.FontOverrideDictionary> -->
</um:MaterialTheme>
<!--#endif-->
<!--#else-->
<!--#if (useCupertino)-->
<CupertinoColors xmlns="using:Uno.Cupertino" />
<CupertinoFonts xmlns="using:Uno.Cupertino" />
<CupertinoResources xmlns="using:Uno.Cupertino" />
<uc:CupertinoColors />
<uc:CupertinoFonts />
<uc:CupertinoResources />
<!--#endif-->
<!--#if (useToolkit)-->
<!-- Load Uno.UI.Toolkit resources -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ public sealed class MaterialFontsOverride : ResourceDictionary
{
public MaterialFontsOverride()
{
this.Build(r => r
.Add<FontFamily>("MaterialLightFontFamily", "ms-appx:///Uno.Fonts.Roboto/Fonts/Material/Roboto-Light.ttf#Roboto")
.Add<FontFamily>("MaterialMediumFontFamily", "ms-appx:///Uno.Fonts.Roboto/Fonts/Material/Roboto-Medium.ttf#Roboto")
.Add<FontFamily>("MaterialRegularFontFamily", "ms-appx:///Uno.Fonts.Roboto/Fonts/Material/Roboto-Regular.ttf#Roboto"));
// NOTE: You can override the default Roboto font by providing your font assets here.
// this.Build(r => r
// .Add<FontFamily>("MaterialLightFontFamily", "ms-appx:///Uno.Fonts.Roboto/Fonts/Material/Roboto-Light.ttf#Roboto")
// .Add<FontFamily>("MaterialMediumFontFamily", "ms-appx:///Uno.Fonts.Roboto/Fonts/Material/Roboto-Medium.ttf#Roboto")
// .Add<FontFamily>("MaterialRegularFontFamily", "ms-appx:///Uno.Fonts.Roboto/Fonts/Material/Roboto-Regular.ttf#Roboto"));
}
}

This file was deleted.

0 comments on commit b4336ce

Please sign in to comment.