From 98ff09aa3ffa5a96887167c509f4f72db65e5b64 Mon Sep 17 00:00:00 2001 From: ema Date: Wed, 25 Mar 2026 01:58:19 +0800 Subject: [PATCH] Update WindowChrome GlassFrameThickness handling --- QuickLook/ViewerWindow.xaml | 2 +- QuickLook/ViewerWindow.xaml.cs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/QuickLook/ViewerWindow.xaml b/QuickLook/ViewerWindow.xaml index b06101f..2a5f584 100644 --- a/QuickLook/ViewerWindow.xaml +++ b/QuickLook/ViewerWindow.xaml @@ -39,7 +39,7 @@ diff --git a/QuickLook/ViewerWindow.xaml.cs b/QuickLook/ViewerWindow.xaml.cs index 2d5526a..f14d076 100644 --- a/QuickLook/ViewerWindow.xaml.cs +++ b/QuickLook/ViewerWindow.xaml.cs @@ -25,6 +25,7 @@ using System.IO; using System.Windows; using System.Windows.Input; using System.Windows.Media.Animation; +using System.Windows.Shell; using Wpf.Ui.Violeta.Controls; using Brush = System.Windows.Media.Brush; using FontFamily = System.Windows.Media.FontFamily; @@ -167,9 +168,14 @@ public partial class ViewerWindow : Window private void ApplyWindowBackgroundEffects() { - if (SettingHelper.Get("UseTransparency", true) + var useTransparency = SettingHelper.Get("UseTransparency", true) && SystemParameters.IsGlassEnabled - && !App.IsGPUInBlacklist) + && !App.IsGPUInBlacklist; + + var windowChrome = WindowChrome.GetWindowChrome(this); + windowChrome?.GlassFrameThickness = useTransparency ? new Thickness(1) : new Thickness(0); + + if (useTransparency) { if (App.IsWin11) { @@ -193,7 +199,6 @@ public partial class ViewerWindow : Window } else { - WindowHelper.DisableBlur(this); Background = (Brush)FindResource("MainWindowBackgroundNoTransparent"); }