From 29ecb753495e92fc22b61d708b7563dd2d42f482 Mon Sep 17 00:00:00 2001 From: dipeshmsft Date: Wed, 26 Jun 2024 02:40:54 +0530 Subject: [PATCH 1/2] Added script for generating combined XAML theme files --- .../Generator/ThemeGenerator.Fluent.ps1 | 43 + .../Resources/Accent.xaml | 3 +- .../Resources/Variables.xaml | 2 +- .../Styles/Calendar.xaml | 4 - .../Styles/DataGrid.xaml | 34 +- .../Styles/ScrollBar.xaml | 16 +- .../Themes/Fluent.Dark.xaml | 4714 +++++++++++++++++ .../Themes/Fluent.Light.xaml | 4709 ++++++++++++++++ 8 files changed, 9494 insertions(+), 31 deletions(-) create mode 100644 src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 create mode 100644 src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Dark.xaml create mode 100644 src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Light.xaml diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 b/src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 new file mode 100644 index 00000000000..4956bb83ee0 --- /dev/null +++ b/src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 @@ -0,0 +1,43 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string][Alias('c')]$themeColor = "Light" +) + +$currentDir = Get-Location +$fluentThemeDir = Join-Path $currentDir "..\PresentationFramework.Fluent\" + +$outFilePath = Join-Path $fluentThemeDir "Themes\Fluent.$themeColor.xaml" + +$styleFilesDir = Join-Path $fluentThemeDir "Styles" +$resouceFilesDir = Join-Path $fluentThemeDir "Resources" +$themeColorFilePath = Join-Path $resouceFilesDir "Theme\$themeColor.xaml" + +[xml]$combinedXaml = ' + ' + +foreach ($file in Get-ChildItem $resouceFilesDir -Filter "*.xaml") { + if($file.BaseName -eq "Fluent") { + continue + } + [xml]$currentXaml = Get-Content $file + + $combinedXaml.ResourceDictionary.InnerXml += $currentXaml.ResourceDictionary.InnerXml +} + +[xml]$themeColorXaml = Get-Content $themeColorFilePath +$combinedXaml.ResourceDictionary.InnerXml += $themeColorXaml.ResourceDictionary.InnerXml + +foreach ($file in Get-ChildItem $styleFilesDir -Filter "*.xaml") { + [xml]$currentXaml = Get-Content $file + + $combinedXaml.ResourceDictionary.InnerXml += $currentXaml.ResourceDictionary.InnerXml +} + +# $combinedXaml += '' + +([xml]$combinedXaml).Save($outFilePath) \ No newline at end of file diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Accent.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Accent.xaml index 1cd063de398..b717ccd3caa 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Accent.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Accent.xaml @@ -40,7 +40,8 @@ x:Key="AccentFillColorTertiaryBrush" Opacity="0.8" Color="{StaticResource SystemAccentColorPrimary}" /> - + + diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Variables.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Variables.xaml index ccff04a06d3..3e764fc25f9 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Variables.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Variables.xaml @@ -46,7 +46,7 @@ 10,0,30,0 24 - 12,1,0,3 + 32 diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Calendar.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Calendar.xaml index 89dd40b8ca0..357c5ecbd16 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Calendar.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Calendar.xaml @@ -10,10 +10,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=System.Runtime"> - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11,5,11,6 + 1 + 8,0,0,0 + 14 + 22 + 22 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12 + 20 + + 1 + 8,6,0,0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12 + 14 + 20 + 28 + 40 + 68 + + + + + + + + 1,1,1,1 + 0,0,0,1 + 10,0,0,0 + 0,0,10,0 + 0,0,4,0 + 0,0,0,0 + 24 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11,5,11,6 + 1 + 8,0,0,0 + 14 + 22 + 22 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12 + 20 + + 1 + 8,6,0,0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12 + 14 + 20 + 28 + 40 + 68 + + + + + + + + 1,1,1,1 + 0,0,0,1 + 10,0,0,0 + 0,0,10,0 + 0,0,4,0 + 0,0,0,0 + 24 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +