diff --git a/Karen/Interop/WCAUtils.cs b/Karen/Interop/WCAUtils.cs index f80d820..515eb98 100644 --- a/Karen/Interop/WCAUtils.cs +++ b/Karen/Interop/WCAUtils.cs @@ -19,7 +19,7 @@ namespace Karen.Interop [DllImport("dwmapi.dll")] public static extern int DwmSetWindowAttribute(IntPtr hwnd, DwmWindowAttribute dwAttribute, ref int pvAttribute, int cbAttribute); - private static bool IsWin11 = Environment.OSVersion.Version >= new Version(10, 0, 22000, 0); + public static bool IsWin11 = Environment.OSVersion.Version >= new Version(10, 0, 22000, 0); [Flags] public enum DwmWindowAttribute : uint @@ -76,9 +76,9 @@ namespace Karen.Interop else { if (darkThemeEnabled) - EnableBlur(hwnd, 0xFF202020); + EnableBlur(hwnd, 0xAA000000); else - EnableBlur(hwnd, 0xFFF3F3F3); + EnableBlur(hwnd, 0x99FFFFFF); } } diff --git a/Karen/KarenPopup.xaml b/Karen/KarenPopup.xaml index 74fa9ce..7f9dcb7 100644 --- a/Karen/KarenPopup.xaml +++ b/Karen/KarenPopup.xaml @@ -12,7 +12,7 @@ Loaded="KarenPopup_Loaded" mc:Ignorable="d"> - + { diff --git a/Karen/MainWindow.xaml b/Karen/MainWindow.xaml index 40e1f7d..5cd46f4 100644 --- a/Karen/MainWindow.xaml +++ b/Karen/MainWindow.xaml @@ -9,10 +9,12 @@ MinWidth="500" MinHeight="480" Width="500" Height="680" Loaded="Window_Loaded" - Background="Transparent" + Title="LANraragi Windows Settings" Foreground="{DynamicResource SystemControlPageTextBaseHighBrush}" + Background="{DynamicResource SystemControlPageBackgroundAltHighBrush}" ui:ThemeManager.IsThemeAware="True" Closing="OnClosing"> + WCAUtils.UpdateStyleAttributes((HwndSource)sender); + if (WCAUtils.IsWin11) + { + // Set a transparent background to let the mica brush come through + Background = new SolidColorBrush(Color.FromArgb(0, 255, 255, 255)); + + WCAUtils.UpdateStyleAttributes((HwndSource)sender); + ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged += (s, ev) => WCAUtils.UpdateStyleAttributes((HwndSource)sender); + } + else + { + WindowChrome.SetWindowChrome(this, null); + } } private void Window_Loaded(object sender, RoutedEventArgs e)