Skip to content

Commit 98ff09a

Browse files
committed
Update WindowChrome GlassFrameThickness handling
1 parent 51f5f1e commit 98ff09a

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

QuickLook/ViewerWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<WindowChrome.WindowChrome>
4040
<WindowChrome CaptionHeight="{StaticResource MainWindowCaptionHeight}"
4141
CornerRadius="0"
42-
GlassFrameThickness=" 1"
42+
GlassFrameThickness="0"
4343
ResizeBorderThickness="{StaticResource MainWindowResizeThickness}"
4444
UseAeroCaptionButtons="False" />
4545
</WindowChrome.WindowChrome>

QuickLook/ViewerWindow.xaml.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
using System.Windows;
2626
using System.Windows.Input;
2727
using System.Windows.Media.Animation;
28+
using System.Windows.Shell;
2829
using Wpf.Ui.Violeta.Controls;
2930
using Brush = System.Windows.Media.Brush;
3031
using FontFamily = System.Windows.Media.FontFamily;
@@ -167,9 +168,14 @@ public override void OnApplyTemplate()
167168

168169
private void ApplyWindowBackgroundEffects()
169170
{
170-
if (SettingHelper.Get("UseTransparency", true)
171+
var useTransparency = SettingHelper.Get("UseTransparency", true)
171172
&& SystemParameters.IsGlassEnabled
172-
&& !App.IsGPUInBlacklist)
173+
&& !App.IsGPUInBlacklist;
174+
175+
var windowChrome = WindowChrome.GetWindowChrome(this);
176+
windowChrome?.GlassFrameThickness = useTransparency ? new Thickness(1) : new Thickness(0);
177+
178+
if (useTransparency)
173179
{
174180
if (App.IsWin11)
175181
{
@@ -193,7 +199,6 @@ private void ApplyWindowBackgroundEffects()
193199
}
194200
else
195201
{
196-
WindowHelper.DisableBlur(this);
197202
Background = (Brush)FindResource("MainWindowBackgroundNoTransparent");
198203
}
199204

0 commit comments

Comments
 (0)