From 2e53ede66b87baf725d60f3222a0edb6fcd22afe Mon Sep 17 00:00:00 2001 From: Meik Date: Thu, 5 Mar 2026 12:17:42 +0100 Subject: [PATCH] Derive header action button colors from dynamic header color --- MainWindow.xaml | 4 ++-- libs/configHelper.cs | 12 ++++++++++++ themes/ThemeDarkNav.xaml | 1 + themes/ThemeLightNav.xaml | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/MainWindow.xaml b/MainWindow.xaml index 3b8d38c..df1bf89 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -281,7 +281,7 @@ Value="True"> + Value="{DynamicResource headerControlHoverBackgroundColor}" /> @@ -300,7 +300,7 @@ + Value="{DynamicResource headerControlBackgroundColor}" /> = 0.55; + Color controlBase = BlendColor(headerColor, isLightHeader ? Colors.Black : Colors.White, isLightHeader ? 0.14 : 0.18); + Color controlHover = BlendColor(headerColor, isLightHeader ? Colors.Black : Colors.White, isLightHeader ? 0.22 : 0.26); + + Application.Current.Resources["headerControlBackgroundColor"] = new SolidColorBrush(controlBase); + Application.Current.Resources["headerControlHoverBackgroundColor"] = new SolidColorBrush(controlHover); + } + public SolidColorBrush GetHeaderColor() { return (SolidColorBrush)System.Windows.Application.Current.Resources["headerColor"]; @@ -995,6 +1005,7 @@ namespace C4IT_CustomerPanel.libs System.Windows.Application.Current.Resources["headerColor"] = new SolidColorBrush(headerColor); ApplyBackgroundDerivedResources(backgroundColor); + ApplyHeaderDerivedResources(headerColor); } catch { @@ -1008,6 +1019,7 @@ namespace C4IT_CustomerPanel.libs System.Windows.Application.Current.Resources["headerColor"] = new SolidColorBrush(fallbackHeader); ApplyBackgroundDerivedResources(fallbackBackground); + ApplyHeaderDerivedResources(fallbackHeader); } try diff --git a/themes/ThemeDarkNav.xaml b/themes/ThemeDarkNav.xaml index 1c5085f..6cae965 100644 --- a/themes/ThemeDarkNav.xaml +++ b/themes/ThemeDarkNav.xaml @@ -26,6 +26,7 @@ + diff --git a/themes/ThemeLightNav.xaml b/themes/ThemeLightNav.xaml index e5bdae3..699d97f 100644 --- a/themes/ThemeLightNav.xaml +++ b/themes/ThemeLightNav.xaml @@ -26,6 +26,7 @@ +