mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-05-16 01:08:03 +08:00
Update WindowChrome GlassFrameThickness handling
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
<WindowChrome.WindowChrome>
|
<WindowChrome.WindowChrome>
|
||||||
<WindowChrome CaptionHeight="{StaticResource MainWindowCaptionHeight}"
|
<WindowChrome CaptionHeight="{StaticResource MainWindowCaptionHeight}"
|
||||||
CornerRadius="0"
|
CornerRadius="0"
|
||||||
GlassFrameThickness=" 1"
|
GlassFrameThickness="0"
|
||||||
ResizeBorderThickness="{StaticResource MainWindowResizeThickness}"
|
ResizeBorderThickness="{StaticResource MainWindowResizeThickness}"
|
||||||
UseAeroCaptionButtons="False" />
|
UseAeroCaptionButtons="False" />
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ using System.IO;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
|
using System.Windows.Shell;
|
||||||
using Wpf.Ui.Violeta.Controls;
|
using Wpf.Ui.Violeta.Controls;
|
||||||
using Brush = System.Windows.Media.Brush;
|
using Brush = System.Windows.Media.Brush;
|
||||||
using FontFamily = System.Windows.Media.FontFamily;
|
using FontFamily = System.Windows.Media.FontFamily;
|
||||||
@@ -167,9 +168,14 @@ public partial class ViewerWindow : Window
|
|||||||
|
|
||||||
private void ApplyWindowBackgroundEffects()
|
private void ApplyWindowBackgroundEffects()
|
||||||
{
|
{
|
||||||
if (SettingHelper.Get("UseTransparency", true)
|
var useTransparency = SettingHelper.Get("UseTransparency", true)
|
||||||
&& SystemParameters.IsGlassEnabled
|
&& 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)
|
if (App.IsWin11)
|
||||||
{
|
{
|
||||||
@@ -193,7 +199,6 @@ public partial class ViewerWindow : Window
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WindowHelper.DisableBlur(this);
|
|
||||||
Background = (Brush)FindResource("MainWindowBackgroundNoTransparent");
|
Background = (Brush)FindResource("MainWindowBackgroundNoTransparent");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user