From 40499a88b8aceffe1541302781beadcee19ca67f Mon Sep 17 00:00:00 2001 From: dipeshmsft Date: Mon, 15 Jul 2024 10:31:24 +0530 Subject: [PATCH 1/6] Implemented SystemColors.AccentColor API --- .../PresentationFramework-ref.baseline.txt | 30 +- .../PresentationFramework.csproj | 1 + .../System/Windows/AccentColorHelper.cs | 64 +++ .../System/Windows/SystemColors.cs | 434 ++++++++++++++++++ .../System/Windows/SystemResourceKey.cs | 99 ++++ .../System/Windows/SystemResources.cs | 6 + 6 files changed, 633 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/AccentColorHelper.cs diff --git a/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/PresentationFramework-ref.baseline.txt b/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/PresentationFramework-ref.baseline.txt index 8c623516c79..db924382512 100644 --- a/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/PresentationFramework-ref.baseline.txt +++ b/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/PresentationFramework-ref.baseline.txt @@ -50,6 +50,34 @@ CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVi CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'System.Windows.Style.TargetType' changed from '[LocalizabilityAttribute(17)]' in the contract to '[LocalizabilityAttribute(LocalizationCategory.NeverLocalize)]' in the implementation. CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVisibilityAttribute' on 'System.Windows.Style.Triggers' changed from '[DesignerSerializationVisibilityAttribute(2)]' in the contract to '[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Windows.StyleTypedPropertyAttribute' changed from '[AttributeUsageAttribute(4, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true)]' in the implementation. +MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColor.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorBrush.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorBrushKey.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorDark1.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorDark1Brush.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark1BrushKey.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark1Key.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorDark2.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorDark2Brush.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark2BrushKey.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark2Key.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorDark3.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorDark3Brush.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark3BrushKey.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorDark3Key.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorKey.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorLight1.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorLight1Brush.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight1BrushKey.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight1Key.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorLight2.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorLight2Brush.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight2BrushKey.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight2Key.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.Color System.Windows.SystemColors.AccentColorLight3.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.Media.SolidColorBrush System.Windows.SystemColors.AccentColorLight3Brush.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight3BrushKey.get()' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Windows.ResourceKey System.Windows.SystemColors.AccentColorLight3Key.get()' does not exist in the implementation but it does exist in the contract. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Windows.TemplatePartAttribute' changed from '[AttributeUsageAttribute(4, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Windows.TemplateVisualStateAttribute' changed from '[AttributeUsageAttribute(4, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Windows.ThemeInfoAttribute' changed from '[AttributeUsageAttribute(1)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Assembly)]' in the implementation. @@ -262,4 +290,4 @@ CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVi CannotChangeAttribute : Attribute 'System.Windows.Markup.DesignerSerializationOptionsAttribute' on 'System.Windows.Markup.XmlAttributeProperties.GetXmlSpace(System.Windows.DependencyObject)' changed from '[DesignerSerializationOptionsAttribute(1)]' in the contract to '[DesignerSerializationOptionsAttribute(DesignerSerializationOptions.SerializeAsAttribute)]' in the implementation. CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVisibilityAttribute' on 'System.Windows.Media.Animation.Storyboard.GetTarget(System.Windows.DependencyObject)' changed from '[DesignerSerializationVisibilityAttribute(0)]' in the contract to '[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]' in the implementation. CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'System.Windows.Shapes.Shape' changed from '[LocalizabilityAttribute(0, Readability=0)]' in the contract to '[LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable)]' in the implementation. -Total Issues: 263 +Total Issues: 291 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/PresentationFramework.csproj b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/PresentationFramework.csproj index ecb8e8dd265..08dff73c8e8 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/PresentationFramework.csproj +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/PresentationFramework.csproj @@ -1087,6 +1087,7 @@ + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/AccentColorHelper.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/AccentColorHelper.cs new file mode 100644 index 00000000000..ee65740de02 --- /dev/null +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/AccentColorHelper.cs @@ -0,0 +1,64 @@ +using System; +using System.Windows.Media; +using System.Windows.Appearance; + +using MS.Internal; +using Microsoft.Win32; +using System.Runtime.InteropServices; +using MS.Internal.WindowsRuntime.Windows.UI.ViewManagement; + + +namespace System.Windows; + +internal static class AccentColorHelper +{ + + #region Internal Methods + + internal static Color GetAccentColor(UISettingsRCW.UIColorType uiColorType = UISettingsRCW.UIColorType.Accent) + { + Color color = _defaultAccentColor; + + if (_UISettings.TryGetColorValue(uiColorType, out color)) + { + return color; + } + + return color; + } + + #endregion + + #region Internal Properties + + internal static Color SystemAccentColor + { + get + { + return GetAccentColor(UISettingsRCW.UIColorType.Accent); + } + } + + internal static UISettings _UISettings + { + get + { + if (_uiSettings == null) + { + _uiSettings = new UISettings(); + } + + return _uiSettings; + } + } + + #endregion + + #region Private Fields + + private static Color _defaultAccentColor = Color.FromArgb(0xff, 0x00, 0x78, 0xd4); + + private static UISettings _uiSettings = null; + + #endregion +} \ No newline at end of file diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemColors.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemColors.cs index a6afebd3126..a2b8c5a8b0a 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemColors.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemColors.cs @@ -7,6 +7,7 @@ using System.Windows.Media; using Microsoft.Win32; using MS.Win32; +using UISettingsRCW = MS.Internal.WindowsRuntime.Windows.UI.ViewManagement.UISettingsRCW; namespace System.Windows { @@ -347,6 +348,62 @@ public static Color WindowTextColor } } + public static Color AccentColor + { + get + { + return GetAccentColor(CacheSlot.AccentColor); + } + } + + public static Color AccentColorLight1 + { + get + { + return GetAccentColor(CacheSlot.AccentColorLight1); + } + } + + public static Color AccentColorLight2 + { + get + { + return GetAccentColor(CacheSlot.AccentColorLight2); + } + } + + public static Color AccentColorLight3 + { + get + { + return GetAccentColor(CacheSlot.AccentColorLight3); + } + } + + public static Color AccentColorDark1 + { + get + { + return GetAccentColor(CacheSlot.AccentColorDark1); + } + } + + public static Color AccentColorDark2 + { + get + { + return GetAccentColor(CacheSlot.AccentColorDark2); + } + } + + public static Color AccentColorDark3 + { + get + { + return GetAccentColor(CacheSlot.AccentColorDark3); + } + } + #endregion [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] @@ -837,6 +894,97 @@ public static ResourceKey WindowTextColorKey } } + public static ResourceKey AccentColorKey + { + get + { + if (_cacheAccentColor == null) + { + _cacheAccentColor = CreateInstance(SystemResourceKeyID.AccentColor); + } + + return _cacheAccentColor; + } + } + + public static ResourceKey AccentColorLight1Key + { + get + { + if (_cacheAccentColorLight1 == null) + { + _cacheAccentColorLight1 = CreateInstance(SystemResourceKeyID.AccentColorLight1); + } + + return _cacheAccentColorLight1; + } + } + + public static ResourceKey AccentColorLight2Key + { + get + { + if (_cacheAccentColorLight2 == null) + { + _cacheAccentColorLight2 = CreateInstance(SystemResourceKeyID.AccentColorLight2); + } + + return _cacheAccentColorLight2; + } + } + + public static ResourceKey AccentColorLight3Key + { + get + { + if (_cacheAccentColorLight3 == null) + { + _cacheAccentColorLight3 = CreateInstance(SystemResourceKeyID.AccentColorLight3); + } + + return _cacheAccentColorLight3; + } + } + + public static ResourceKey AccentColorDark1Key + { + get + { + if (_cacheAccentColorDark1 == null) + { + _cacheAccentColorDark1 = CreateInstance(SystemResourceKeyID.AccentColorDark1); + } + + return _cacheAccentColorDark1; + } + } + + public static ResourceKey AccentColorDark2Key + { + get + { + if (_cacheAccentColorDark2 == null) + { + _cacheAccentColorDark2 = CreateInstance(SystemResourceKeyID.AccentColorDark2); + } + + return _cacheAccentColorDark2; + } + } + + public static ResourceKey AccentColorDark3Key + { + get + { + if (_cacheAccentColorDark3 == null) + { + _cacheAccentColorDark3 = CreateInstance(SystemResourceKeyID.AccentColorDark3); + } + + return _cacheAccentColorDark3; + } + } + #endregion #region Brushes @@ -1213,6 +1361,111 @@ public static SolidColorBrush InactiveSelectionHighlightTextBrush } } + public static SolidColorBrush AccentColorBrush + { + get + { + if (SystemParameters.HighContrast) + { + return SystemColors.HighlightTextBrush; + } + else + { + return MakeAccentBrush(CacheSlot.AccentColor); + } + } + } + + public static SolidColorBrush AccentColorLight1Brush + { + get + { + if (SystemParameters.HighContrast) + { + return SystemColors.HighlightTextBrush; + } + else + { + return MakeAccentBrush(CacheSlot.AccentColorLight1); + } + } + } + + public static SolidColorBrush AccentColorLight2Brush + { + get + { + if (SystemParameters.HighContrast) + { + return SystemColors.HighlightTextBrush; + } + else + { + return MakeAccentBrush(CacheSlot.AccentColorLight2); + } + } + } + + public static SolidColorBrush AccentColorLight3Brush + { + get + { + if (SystemParameters.HighContrast) + { + return SystemColors.HighlightTextBrush; + } + else + { + return MakeAccentBrush(CacheSlot.AccentColorLight3); + } + } + } + + public static SolidColorBrush AccentColorDark1Brush + { + get + { + if (SystemParameters.HighContrast) + { + return SystemColors.HighlightTextBrush; + } + else + { + return MakeAccentBrush(CacheSlot.AccentColorDark1); + } + } + } + + public static SolidColorBrush AccentColorDark2Brush + { + get + { + if (SystemParameters.HighContrast) + { + return SystemColors.HighlightTextBrush; + } + else + { + return MakeAccentBrush(CacheSlot.AccentColorDark2); + } + } + } + + public static SolidColorBrush AccentColorDark3Brush + { + get + { + if (SystemParameters.HighContrast) + { + return SystemColors.HighlightTextBrush; + } + else + { + return MakeAccentBrush(CacheSlot.AccentColorDark3); + } + } + } + #endregion #region Brush Keys @@ -1743,6 +1996,97 @@ public static ResourceKey InactiveSelectionHighlightTextBrushKey } } + public static ResourceKey AccentColorBrushKey + { + get + { + if(_cacheAccentColorBrush == null) + { + _cacheAccentColorBrush = CreateInstance(SystemResourceKeyID.AccentColorBrush); + } + + return _cacheAccentColorBrush; + } + } + + public static ResourceKey AccentColorLight1BrushKey + { + get + { + if(_cacheAccentColorLight1Brush == null) + { + _cacheAccentColorLight1Brush = CreateInstance(SystemResourceKeyID.AccentColorLight1Brush); + } + + return _cacheAccentColorLight1Brush; + } + } + + public static ResourceKey AccentColorLight2BrushKey + { + get + { + if(_cacheAccentColorLight2Brush == null) + { + _cacheAccentColorLight2Brush = CreateInstance(SystemResourceKeyID.AccentColorLight2Brush); + } + + return _cacheAccentColorLight2Brush; + } + } + + public static ResourceKey AccentColorLight3BrushKey + { + get + { + if(_cacheAccentColorLight3Brush == null) + { + _cacheAccentColorLight3Brush = CreateInstance(SystemResourceKeyID.AccentColorLight3Brush); + } + + return _cacheAccentColorLight3Brush; + } + } + + public static ResourceKey AccentColorDark1BrushKey + { + get + { + if(_cacheAccentColorDark1Brush == null) + { + _cacheAccentColorDark1Brush = CreateInstance(SystemResourceKeyID.AccentColorDark1Brush); + } + + return _cacheAccentColorDark1Brush; + } + } + + public static ResourceKey AccentColorDark2BrushKey + { + get + { + if(_cacheAccentColorDark2Brush == null) + { + _cacheAccentColorDark2Brush = CreateInstance(SystemResourceKeyID.AccentColorDark2Brush); + } + + return _cacheAccentColorDark2Brush; + } + } + + public static ResourceKey AccentColorDark3BrushKey + { + get + { + if(_cacheAccentColorDark3Brush == null) + { + _cacheAccentColorDark3Brush = CreateInstance(SystemResourceKeyID.AccentColorDark3Brush); + } + + return _cacheAccentColorDark3Brush; + } + } + #endregion #region Implementation @@ -1808,6 +2152,53 @@ private static Color GetSystemColor(CacheSlot slot) return color; } + private static Color GetAccentColor(CacheSlot slot) + { + Color color; + + lock (_colorCacheValid) + { + while(!_colorCacheValid[(int)slot]) + { + _colorCacheValid[(int)slot] = true; + + switch(slot) + { + case CacheSlot.AccentColor: + color = AccentColorHelper.GetAccentColor(UISettingsRCW.UIColorType.Accent); + break; + case CacheSlot.AccentColorLight1: + color = AccentColorHelper.GetAccentColor(UISettingsRCW.UIColorType.AccentLight1); + break; + case CacheSlot.AccentColorLight2: + color = AccentColorHelper.GetAccentColor(UISettingsRCW.UIColorType.AccentLight2); + break; + case CacheSlot.AccentColorLight3: + color = AccentColorHelper.GetAccentColor(UISettingsRCW.UIColorType.AccentLight3); + break; + case CacheSlot.AccentColorDark1: + color = AccentColorHelper.GetAccentColor(UISettingsRCW.UIColorType.AccentDark1); + break; + case CacheSlot.AccentColorDark2: + color = AccentColorHelper.GetAccentColor(UISettingsRCW.UIColorType.AccentDark2); + break; + case CacheSlot.AccentColorDark3: + color = AccentColorHelper.GetAccentColor(UISettingsRCW.UIColorType.AccentDark3); + break; + default: + color = Colors.Transparent; + break; + } + + _colorCache[(int)slot] = color; + } + + color = _colorCache[(int)slot]; + } + + return color; + } + private static SolidColorBrush MakeBrush(CacheSlot slot) { SolidColorBrush brush; @@ -1831,6 +2222,28 @@ private static SolidColorBrush MakeBrush(CacheSlot slot) return brush; } + private static SolidColorBrush MakeAccentBrush(CacheSlot slot) + { + SolidColorBrush brush; + + lock(_brushCacheValid) + { + while(!_brushCacheValid[(int)slot]) + { + _brushCacheValid[(int)slot] = true; + + brush = new SolidColorBrush(GetAccentColor(slot)); + brush.Freeze(); + + _brushCache[(int)slot] = brush; + } + + brush = _brushCache[(int)slot]; + } + + return brush; + } + private static int SlotToFlag(CacheSlot slot) { // FxCop: Hashtable would be overkill, using switch instead @@ -1934,6 +2347,13 @@ private enum CacheSlot : int Window, WindowFrame, WindowText, + AccentColor, + AccentColorLight1, + AccentColorLight2, + AccentColorLight3, + AccentColorDark1, + AccentColorDark2, + AccentColorDark3, NumSlots } @@ -1975,6 +2395,13 @@ private enum CacheSlot : int private static SystemResourceKey _cacheWindowTextBrush; private static SystemResourceKey _cacheInactiveSelectionHighlightBrush; private static SystemResourceKey _cacheInactiveSelectionHighlightTextBrush; + private static SystemResourceKey _cacheAccentColorBrush; + private static SystemResourceKey _cacheAccentColorLight1Brush; + private static SystemResourceKey _cacheAccentColorLight2Brush; + private static SystemResourceKey _cacheAccentColorLight3Brush; + private static SystemResourceKey _cacheAccentColorDark1Brush; + private static SystemResourceKey _cacheAccentColorDark2Brush; + private static SystemResourceKey _cacheAccentColorDark3Brush; private static SystemResourceKey _cacheActiveBorderColor; private static SystemResourceKey _cacheActiveCaptionColor; private static SystemResourceKey _cacheActiveCaptionTextColor; @@ -2005,6 +2432,13 @@ private enum CacheSlot : int private static SystemResourceKey _cacheWindowColor; private static SystemResourceKey _cacheWindowFrameColor; private static SystemResourceKey _cacheWindowTextColor; + private static SystemResourceKey _cacheAccentColor; + private static SystemResourceKey _cacheAccentColorLight1; + private static SystemResourceKey _cacheAccentColorLight2; + private static SystemResourceKey _cacheAccentColorLight3; + private static SystemResourceKey _cacheAccentColorDark1; + private static SystemResourceKey _cacheAccentColorDark2; + private static SystemResourceKey _cacheAccentColorDark3; #endregion } diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemResourceKey.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemResourceKey.cs index afaaf209374..5b8d4192ea7 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemResourceKey.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemResourceKey.cs @@ -282,6 +282,21 @@ internal enum SystemResourceKeyID InactiveSelectionHighlightBrush, InactiveSelectionHighlightTextBrush, + AccentColor, + AccentColorLight1, + AccentColorLight2, + AccentColorLight3, + AccentColorDark1, + AccentColorDark2, + AccentColorDark3, + AccentColorBrush, + AccentColorLight1Brush, + AccentColorLight2Brush, + AccentColorLight3Brush, + AccentColorDark1Brush, + AccentColorDark2Brush, + AccentColorDark3Brush, + InternalSystemColorsExtendedEnd } @@ -535,6 +550,27 @@ internal object Resource case SystemResourceKeyID.InactiveSelectionHighlightTextBrush: return SystemColors.InactiveSelectionHighlightTextBrush; + case SystemResourceKeyID.AccentColorBrush: + return SystemColors.AccentColorBrush; + + case SystemResourceKeyID.AccentColorLight1Brush: + return SystemColors.AccentColorLight1Brush; + + case SystemResourceKeyID.AccentColorLight2Brush: + return SystemColors.AccentColorLight2Brush; + + case SystemResourceKeyID.AccentColorLight3Brush: + return SystemColors.AccentColorLight3Brush; + + case SystemResourceKeyID.AccentColorDark1Brush: + return SystemColors.AccentColorDark1Brush; + + case SystemResourceKeyID.AccentColorDark2Brush: + return SystemColors.AccentColorDark2Brush; + + case SystemResourceKeyID.AccentColorDark3Brush: + return SystemColors.AccentColorDark3Brush; + case SystemResourceKeyID.ActiveBorderColor: return SystemColors.ActiveBorderColor; @@ -625,6 +661,27 @@ internal object Resource case SystemResourceKeyID.WindowTextColor: return SystemColors.WindowTextColor; + case SystemResourceKeyID.AccentColor: + return SystemColors.AccentColor; + + case SystemResourceKeyID.AccentColorLight1: + return SystemColors.AccentColorLight1; + + case SystemResourceKeyID.AccentColorLight2: + return SystemColors.AccentColorLight2; + + case SystemResourceKeyID.AccentColorLight3: + return SystemColors.AccentColorLight3; + + case SystemResourceKeyID.AccentColorDark1: + return SystemColors.AccentColorDark1; + + case SystemResourceKeyID.AccentColorDark2: + return SystemColors.AccentColorDark2; + + case SystemResourceKeyID.AccentColorDark3: + return SystemColors.AccentColorDark3; + case SystemResourceKeyID.ThinHorizontalBorderHeight: return SystemParameters.ThinHorizontalBorderHeight; @@ -1177,6 +1234,27 @@ internal static ResourceKey GetResourceKey(short id) case (short)SystemResourceKeyID.InactiveSelectionHighlightTextBrush: return SystemColors.InactiveSelectionHighlightTextBrushKey; + case (short)SystemResourceKeyID.AccentColorBrush: + return SystemColors.AccentColorBrushKey; + + case (short)SystemResourceKeyID.AccentColorLight1Brush: + return SystemColors.AccentColorLight1BrushKey; + + case (short)SystemResourceKeyID.AccentColorLight2Brush: + return SystemColors.AccentColorLight2BrushKey; + + case (short)SystemResourceKeyID.AccentColorLight3Brush: + return SystemColors.AccentColorLight3BrushKey; + + case (short)SystemResourceKeyID.AccentColorDark1Brush: + return SystemColors.AccentColorDark1BrushKey; + + case (short)SystemResourceKeyID.AccentColorDark2Brush: + return SystemColors.AccentColorDark2BrushKey; + + case (short)SystemResourceKeyID.AccentColorDark3Brush: + return SystemColors.AccentColorDark3BrushKey; + case (short)SystemResourceKeyID.ActiveBorderColor: return SystemColors.ActiveBorderColorKey; @@ -1267,6 +1345,27 @@ internal static ResourceKey GetResourceKey(short id) case (short)SystemResourceKeyID.WindowTextColor: return SystemColors.WindowTextColorKey; + case (short)SystemResourceKeyID.AccentColor: + return SystemColors.AccentColorKey; + + case (short)SystemResourceKeyID.AccentColorLight1: + return SystemColors.AccentColorLight1Key; + + case (short)SystemResourceKeyID.AccentColorLight2: + return SystemColors.AccentColorLight2Key; + + case (short)SystemResourceKeyID.AccentColorLight3: + return SystemColors.AccentColorLight3Key; + + case (short)SystemResourceKeyID.AccentColorDark1: + return SystemColors.AccentColorDark1Key; + + case (short)SystemResourceKeyID.AccentColorDark2: + return SystemColors.AccentColorDark2Key; + + case (short)SystemResourceKeyID.AccentColorDark3: + return SystemColors.AccentColorDark3Key; + case (short)SystemResourceKeyID.ThinHorizontalBorderHeight: return SystemParameters.ThinHorizontalBorderHeightKey; diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemResources.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemResources.cs index 4a6622b9d01..4e181a12101 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemResources.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemResources.cs @@ -1434,6 +1434,12 @@ private static IntPtr SystemThemeFilterMessage(IntPtr hwnd, int msg, IntPtr wPar case WindowMessage.WM_DWMCOLORIZATIONCOLORCHANGED: SystemParameters.InvalidateWindowGlassColorizationProperties(); + + if(SystemColors.InvalidateCache()) + { + OnSystemValueChanged(); + InvalidateResources(true); + } break; } From 2e47a67a82e5675d1486143dfd750458c72725ff Mon Sep 17 00:00:00 2001 From: dipeshmsft Date: Mon, 15 Jul 2024 22:46:11 +0530 Subject: [PATCH 2/6] Replaced accent color usage in Fluent resources with SystemColor.AccentColor's --- .../Resources/Accent.xaml | 35 ----- .../Resources/Theme/Dark.xaml | 124 +++++++++-------- .../Resources/Theme/Light.xaml | 126 ++++++++++-------- 3 files changed, 139 insertions(+), 146 deletions(-) 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..2ba130c2f03 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 @@ -7,41 +7,6 @@ - - #3379d9 - - - #559ce4 - - #80b9ee - - #add8ff - - - - - - - - - - - - - - - - - - - - diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml index 4df7c81f930..af25d1275ab 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml @@ -131,6 +131,34 @@ #2E2E2E #2E2E2E + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -140,14 +168,6 @@ - - - - - - - - @@ -176,8 +196,6 @@ - - @@ -316,10 +334,6 @@ - - - - @@ -327,9 +341,9 @@ - - - + + + @@ -357,9 +371,9 @@ - - - + + + @@ -385,9 +399,9 @@ - - - + + + @@ -407,11 +421,11 @@ - + - + @@ -430,7 +444,7 @@ - + @@ -460,9 +474,9 @@ - - - + + + @@ -480,7 +494,7 @@ - + @@ -488,15 +502,15 @@ - - - + + + - + @@ -520,7 +534,7 @@ - + @@ -536,26 +550,26 @@ - + - + - - + + - - - + + + @@ -565,7 +579,7 @@ - + @@ -586,8 +600,8 @@ - - + + @@ -614,13 +628,13 @@ - + - + @@ -640,9 +654,9 @@ - - - + + + @@ -662,11 +676,11 @@ - - + + - - + + @@ -696,5 +710,5 @@ - + diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml index 8cff90cb613..7056ecff16d 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml @@ -35,7 +35,7 @@ #FFFFFF #FFFFFF #B3FFFFFF - #A3FFFFFF + #FFFFFF #B3FFFFFF #80F9F9F9 @@ -131,6 +131,34 @@ #F7F7F7 #F3F3F3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -140,14 +168,6 @@ - - - - - - - - @@ -176,8 +196,6 @@ - - @@ -311,19 +329,15 @@ - - - - - - - + + + @@ -351,9 +365,9 @@ - - - + + + @@ -379,9 +393,9 @@ - - - + + + @@ -401,11 +415,11 @@ - + - + @@ -424,7 +438,7 @@ - + @@ -454,9 +468,9 @@ - - - + + + @@ -474,7 +488,7 @@ - + @@ -483,15 +497,15 @@ #FFF2F2F2 - - - + + + - + @@ -515,7 +529,7 @@ - + @@ -531,26 +545,26 @@ - + - + - - + + - - - + + + @@ -560,7 +574,7 @@ - + @@ -581,8 +595,8 @@ - - + + @@ -609,13 +623,13 @@ - + - + @@ -635,9 +649,9 @@ - - - + + + @@ -657,11 +671,11 @@ - - + + - - + + @@ -691,5 +705,5 @@ - + From 4fce466282a0ac90af885fbcb57b4c7b8d97046d Mon Sep 17 00:00:00 2001 From: dipeshmsft Date: Mon, 15 Jul 2024 22:47:05 +0530 Subject: [PATCH 3/6] Removed usage of DWMColoization --- .../PresentationFramework.csproj | 1 - .../System/Windows/DWMColorization.cs | 173 ------------------ .../System/Windows/ThemeManager.cs | 53 ++++-- 3 files changed, 39 insertions(+), 188 deletions(-) delete mode 100644 src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/DWMColorization.cs diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/PresentationFramework.csproj b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/PresentationFramework.csproj index 08dff73c8e8..0f5ba7b3ebd 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/PresentationFramework.csproj +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/PresentationFramework.csproj @@ -1088,7 +1088,6 @@ - diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/DWMColorization.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/DWMColorization.cs deleted file mode 100644 index 120d39cfbf8..00000000000 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/DWMColorization.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.Diagnostics; -using System.Windows.Appearance; -using System.Windows.Media; -using Microsoft.Win32; -using MS.Internal; -using System.Runtime.InteropServices; -using MS.Internal.WindowsRuntime.Windows.UI.ViewManagement; - -namespace System.Windows; -internal static class DwmColorization -{ - private static Color _currentApplicationAccentColor = Color.FromArgb(0xff, 0x00, 0x78, 0xd4); - - private static UISettings _uiSettings = null; - - /// - /// Gets the current application accent color. - /// - internal static Color CurrentApplicationAccentColor - { - get { return _currentApplicationAccentColor; } - } - - internal static UISettings _UISettings - { - get - { - if (_uiSettings == null) - { - _uiSettings = new UISettings(); - } - - return _uiSettings; - } - } - - /// - /// Gets the system accent color. - /// - /// Updated Accent Color. - internal static Color GetSystemAccentColor() - { - _UISettings.TryGetColorValue(UISettingsRCW.UIColorType.Accent, out Color systemAccent); - return systemAccent; - } - - /// - /// Computes the current Accent Colors and calls for updating of accent color values in resource dictionary - /// - internal static void UpdateAccentColors() - { - Color systemAccent = GetSystemAccentColor(); - Color primaryAccent, secondaryAccent, tertiaryAccent; - - if (systemAccent != _currentApplicationAccentColor) - { - _UISettings.TryUpdateAccentColors(); - } - - if (ThemeManager.IsSystemThemeLight()) - { - // In light mode, we use darker shades of the accent color - primaryAccent = _UISettings.AccentDark1; - secondaryAccent = _UISettings.AccentDark2; - tertiaryAccent = _UISettings.AccentDark3; - } - else - { - // In dark mode, we use lighter shades of the accent color - primaryAccent = _UISettings.AccentLight1; - secondaryAccent = _UISettings.AccentLight2; - tertiaryAccent = _UISettings.AccentLight3; - } - - UpdateColorResources(systemAccent, primaryAccent, secondaryAccent, tertiaryAccent); - _currentApplicationAccentColor = systemAccent; - } - - /// - /// Updates application resources. - /// - private static void UpdateColorResources( - Color systemAccent, - Color primaryAccent, - Color secondaryAccent, - Color tertiaryAccent) - { -#if DEBUG - System.Diagnostics.Debug.WriteLine("INFO | SystemAccentColor: " + systemAccent, "System.Windows.Accent"); - System - .Diagnostics - .Debug - .WriteLine("INFO | SystemAccentColorPrimary: " + primaryAccent, "System.Windows.Accent"); - System - .Diagnostics - .Debug - .WriteLine("INFO | SystemAccentColorSecondary: " + secondaryAccent, "System.Windows.Accent"); - System - .Diagnostics - .Debug - .WriteLine("INFO | SystemAccentColorTertiary: " + tertiaryAccent, "System.Windows.Accent"); -#endif - - if (!ThemeManager.IsSystemThemeLight()) - { -#if DEBUG - System.Diagnostics.Debug.WriteLine("INFO | Text on accent is DARK", "System.Windows.Accent"); -#endif - Application.Current.Resources["TextOnAccentFillColorPrimary"] = - Color.FromArgb( 0xFF, 0x00, 0x00, 0x00); - - Application.Current.Resources["TextOnAccentFillColorSecondary"] = - Color.FromArgb( 0x80, 0x00, 0x00, 0x00); - - Application.Current.Resources["TextOnAccentFillColorDisabled"] = - Color.FromArgb( 0x77, 0x00, 0x00, 0x00); - - Application.Current.Resources["TextOnAccentFillColorSelectedText"] = - Color.FromArgb( 0x00, 0x00, 0x00, 0x00); - - Application.Current.Resources["AccentTextFillColorDisabled"] = - Color.FromArgb( 0x5D, 0x00, 0x00, 0x00); - } - else - { -#if DEBUG - System.Diagnostics.Debug.WriteLine("INFO | Text on accent is LIGHT", "System.Windows.Accent"); -#endif - Application.Current.Resources["TextOnAccentFillColorPrimary"] = - Color.FromArgb( 0xFF, 0xFF, 0xFF, 0xFF); - - Application.Current.Resources["TextOnAccentFillColorSecondary"] = - Color.FromArgb( 0x80, 0xFF, 0xFF, 0xFF); - - Application.Current.Resources["TextOnAccentFillColorDisabled"] = - Color.FromArgb( 0x87, 0xFF, 0xFF, 0xFF); - - Application.Current.Resources["TextOnAccentFillColorSelectedText"] = - Color.FromArgb( 0xFF, 0xFF, 0xFF, 0xFF); - - Application.Current.Resources["AccentTextFillColorDisabled"] = - Color.FromArgb( 0x5D, 0xFF, 0xFF, 0xFF); - } - - Application.Current.Resources["SystemAccentColor"] = systemAccent; - Application.Current.Resources["SystemAccentColorPrimary"] = primaryAccent; - Application.Current.Resources["SystemAccentColorSecondary"] = secondaryAccent; - Application.Current.Resources["SystemAccentColorTertiary"] = tertiaryAccent; - - Application.Current.Resources["SystemAccentBrush"] = ToBrush(systemAccent); - Application.Current.Resources["SystemFillColorAttentionBrush"] = ToBrush(secondaryAccent); - Application.Current.Resources["AccentTextFillColorPrimaryBrush"] = ToBrush(tertiaryAccent); - Application.Current.Resources["AccentTextFillColorSecondaryBrush"] = ToBrush(tertiaryAccent); - Application.Current.Resources["AccentTextFillColorTertiaryBrush"] = ToBrush(secondaryAccent); - Application.Current.Resources["AccentFillColorSelectedTextBackgroundBrush"] = ToBrush(systemAccent); - Application.Current.Resources["AccentFillColorDefaultBrush"] = ToBrush(secondaryAccent); - - Application.Current.Resources["AccentFillColorSecondaryBrush"] = ToBrush(secondaryAccent, 0.9); - Application.Current.Resources["AccentFillColorTertiaryBrush"] = ToBrush(secondaryAccent, 0.8); - } - - /// - /// Creates a from a with defined brush opacity. - /// - /// Input color. - /// Degree of opacity. - /// Brush converted to color with modified opacity. - private static SolidColorBrush ToBrush(Color color, double opacity = 1.0) - { - return new SolidColorBrush { Color = color, Opacity = opacity }; - } -} \ No newline at end of file diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ThemeManager.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ThemeManager.cs index 039728e28be..1952eb953b5 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ThemeManager.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ThemeManager.cs @@ -43,7 +43,6 @@ internal static void InitializeFluentTheme() var themeColorResourceUri = GetFluentWindowThemeColorResourceUri(_currentApplicationTheme, _currentUseLightMode); Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = themeColorResourceUri }); - DwmColorization.UpdateAccentColors(); _isFluentThemeInitialized = true; } } @@ -78,7 +77,7 @@ internal static void ApplySystemTheme(IEnumerable windows = null, bool forceUpda string systemTheme = GetSystemTheme(); bool useLightMode = IsSystemThemeLight(); - Color systemAccentColor = DwmColorization.GetSystemAccentColor(); + Color systemAccentColor = AccentColorHelper.SystemAccentColor; ApplyTheme(windows , systemTheme, useLightMode, systemAccentColor, forceUpdate); } @@ -101,9 +100,8 @@ private static void ApplyTheme( if(forceUpdate || requestedTheme != _currentApplicationTheme || requestedUseLightMode != _currentUseLightMode || - DwmColorization.GetSystemAccentColor() != DwmColorization.CurrentApplicationAccentColor) + requestedAccentColor != _currentSystemAccentColor) { - DwmColorization.UpdateAccentColors(); Uri dictionaryUri = GetFluentWindowThemeColorResourceUri(requestedTheme, requestedUseLightMode); AddOrUpdateThemeResources(dictionaryUri); @@ -121,6 +119,7 @@ private static void ApplyTheme( _currentApplicationTheme = requestedTheme; _currentUseLightMode = requestedUseLightMode; + _currentSystemAccentColor = requestedAccentColor; } } @@ -192,18 +191,14 @@ private static void AddOrUpdateThemeResources(Uri dictionaryUri) var newDictionary = new ResourceDictionary() { Source = dictionaryUri }; - ResourceDictionary currentDictionary = Application.Current?.Resources; - foreach (var key in newDictionary.Keys) + FindFluentThemeAndColorDictionary(out ResourceDictionary fluentDictionary, out ResourceDictionary colorDictionary); + + if (colorDictionary != null) { - if (currentDictionary.Contains(key)) - { - currentDictionary[key] = newDictionary[key]; - } - else - { - currentDictionary.Add(key, newDictionary[key]); - } + Application.Current.Resources.MergedDictionaries.Remove(colorDictionary); } + + Application.Current.Resources.MergedDictionaries.Add(newDictionary); } #endregion @@ -232,6 +227,31 @@ private static Uri GetFluentWindowThemeColorResourceUri(string systemTheme, bool return new Uri("pack://application:,,,/PresentationFramework.Fluent;component/Resources/Theme/" + themeColorFileName, UriKind.Absolute); } + private static void FindFluentThemeAndColorDictionary(out ResourceDictionary fluentThemeDictionary, out ResourceDictionary fluentColorDictionary) + { + fluentThemeDictionary = null; + fluentColorDictionary = null; + + if (Application.Current == null) return; + + foreach (ResourceDictionary mergedDictionary in Application.Current.Resources.MergedDictionaries) + { + if (mergedDictionary.Source != null) + { + if (mergedDictionary.Source.ToString() == fluentResourceDictionaryUri) + { + fluentThemeDictionary = mergedDictionary; + } + else if (mergedDictionary.Source.ToString().StartsWith(fluentColorResourceUriPart)) + { + fluentColorDictionary = mergedDictionary; + } + } + } + } + + + #endregion #region Private Members @@ -240,6 +260,9 @@ private static Uri GetFluentWindowThemeColorResourceUri(string systemTheme, bool private static readonly string _regPersonalizeKeyPath = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; + private static readonly string fluentResourceDictionaryUri = "pack://application:,,,/PresentationFramework.Fluent;component/Resources/Fluent.xaml"; + private static readonly string fluentColorResourceUriPart = "pack://application:,,,/PresentationFramework.Fluent;component/Resources/Theme/"; + private static string _currentApplicationTheme; private static bool _currentUseLightMode = true; @@ -248,5 +271,7 @@ private static Uri GetFluentWindowThemeColorResourceUri(string systemTheme, bool private static bool _isFluentThemeInitialized = false; + private static Color _currentSystemAccentColor = AccentColorHelper.SystemAccentColor; + #endregion } \ No newline at end of file From 01a2d0115be0aa6e32dfeb5424800b2ebe8c869b Mon Sep 17 00:00:00 2001 From: dipeshmsft Date: Wed, 17 Jul 2024 14:15:34 +0530 Subject: [PATCH 4/6] Added accent colors and brushes in HC.xaml --- .../Resources/Theme/HC.xaml | 51 +++++++++++-------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml index 9aaf8c63342..013cf0aa0e4 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml @@ -16,11 +16,6 @@ https://github.com/microsoft/microsoft-ui-xaml/blob/main/dev/CommonStyles/Common_themeresources_any.xaml --> - - #4cc2ff - #4cc2ff - #4cc2ff - @@ -39,22 +34,43 @@ - + - - - - - - + + + + + + + + + + - + + + + + + + + + + + + + + + + + + @@ -84,8 +100,6 @@ - - @@ -202,10 +216,6 @@ - - - - @@ -587,9 +597,6 @@ - - - #FFFFFF From db44277c308a00eda257a4ec9884350adbc9f2e5 Mon Sep 17 00:00:00 2001 From: dipeshmsft Date: Wed, 17 Jul 2024 14:37:45 +0530 Subject: [PATCH 5/6] Removed extra files --- .../Resources/Accent.xaml | 12 ------------ .../Resources/Fluent.xaml | 1 - 2 files changed, 13 deletions(-) delete mode 100644 src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Accent.xaml 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 deleted file mode 100644 index 2ba130c2f03..00000000000 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Accent.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Fluent.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Fluent.xaml index 4903465b787..997374bd26b 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Fluent.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Fluent.xaml @@ -6,7 +6,6 @@ --> - From d405813d063f0f278e4d3b598e32327ee07432d2 Mon Sep 17 00:00:00 2001 From: dipeshmsft Date: Wed, 17 Jul 2024 19:26:24 +0530 Subject: [PATCH 6/6] Merging main branch into fluent/use-systemcolor-accentcolor-fluent --- .../Resources/Theme/Dark.xaml | 66 ++++++------------- .../Resources/Theme/HC.xaml | 45 +------------ .../Resources/Theme/Light.xaml | 63 +++++------------- 3 files changed, 39 insertions(+), 135 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml index af25d1275ab..870c7365dbd 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml @@ -28,14 +28,13 @@ #C5FFFFFF #87FFFFFF #5DFFFFFF - #87FFFFFF #E4000000 #5DFFFFFF #FFFFFF #000000 #80000000 - #77000000 + #87FFFFFF #0FFFFFFF #15FFFFFF @@ -53,11 +52,10 @@ #0FFFFFFF #0AFFFFFF #00FFFFFF - #4A4A4A #00FFFFFF #19000000 - #FF373737 + #0BFFFFFF #12FFFFFF #00FFFFFF @@ -70,7 +68,6 @@ #12FFFFFF #18FFFFFF - #C5FFFFFF #14FFFFFF #23000000 #37000000 @@ -158,6 +155,15 @@ + + #FF00FF + #FF00FF + #FF00FF + #FF00FF + #FF00FF + #FF00FF + #FF00FF + #FF00FF @@ -165,7 +171,6 @@ - @@ -198,7 +203,6 @@ - @@ -294,44 +298,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + @@ -404,7 +378,7 @@ - + diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml index 013cf0aa0e4..521942f2314 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml @@ -69,7 +69,6 @@ - @@ -102,11 +101,10 @@ - - + @@ -175,45 +173,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -603,7 +562,6 @@ #FFFFFF #FFFFFF #A6A6A6 - #FF0000 #FFFFFF #A6A6A6 @@ -644,7 +602,6 @@ #B6F6F0 #B6F6F0 - #B6F6F0 #B6F6F0 #B6F6F0 #B6F6F0 diff --git a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml index 7056ecff16d..8a5de8b4cf6 100644 --- a/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml +++ b/src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml @@ -28,7 +28,6 @@ #9E000000 #72000000 #5C000000 - #9E000000 #FFFFFF #5C000000 @@ -53,11 +52,10 @@ #09000000 #06000000 #00FFFFFF - #B6B6B6 #00FFFFFF #06000000 - #FFE9E9E9 + #0F000000 #18000000 #00FFFFFF @@ -70,7 +68,6 @@ #0F000000 #29000000 - #9E000000 #14FFFFFF #66000000 #37000000 @@ -158,6 +155,14 @@ + #FF00FF + #FF00FF + #FF00FF + #FF00FF + #FF00FF + #FF00FF + #FF00FF + #FF00FF @@ -165,7 +170,6 @@ - @@ -198,7 +202,6 @@ - @@ -288,44 +291,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + @@ -398,7 +371,7 @@ - +