From 8090c1ea238f7d60b6d889a240674d6fd99c49ad Mon Sep 17 00:00:00 2001 From: dipeshmsft Date: Wed, 17 Jul 2024 20:41:05 +0530 Subject: [PATCH 1/3] Added theme generator script and modified resources to remove duplicate keys --- .../Generator/ThemeGenerator.Fluent.ps1 | 45 +++++++++++++++++++ .../Resources/Variables.xaml | 2 +- .../Styles/Calendar.xaml | 4 -- .../Styles/DataGrid.xaml | 38 ++++++++-------- .../Styles/Expander.xaml | 4 +- .../Styles/ScrollBar.xaml | 16 +++---- 6 files changed, 75 insertions(+), 34 deletions(-) create mode 100644 src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 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..2dd67279fb5 --- /dev/null +++ b/src/Microsoft.DotNet.Wpf/src/Themes/Generator/ThemeGenerator.Fluent.ps1 @@ -0,0 +1,45 @@ +[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 +} + +([xml]$combinedXaml).Save($outFilePath) \ No newline at end of file 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 897cf3e805a..1807342c2f2 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"> - - - - - + - #FFFF0000 + - 11,5,11,6 - 1 - 8,0,0,0 - 14 - 22 - 22 + 11,5,11,6 + 1 + 8,0,0,0 + 14 + 22 + 22 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +