Update WindowChrome GlassFrameThickness handling

This commit is contained in:
ema
2026-03-25 01:58:19 +08:00
parent 51f5f1e163
commit 98ff09aa3f
2 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -39,7 +39,7 @@
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="{StaticResource MainWindowCaptionHeight}"
CornerRadius="0"
GlassFrameThickness=" 1"
GlassFrameThickness="0"
ResizeBorderThickness="{StaticResource MainWindowResizeThickness}"
UseAeroCaptionButtons="False" />
</WindowChrome.WindowChrome>
+8 -3
View File
@@ -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");
}