mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-02 10:48:37 +00:00
Fix #1147: DWM blur in Windows 10 and 11
This commit is contained in:
Submodule QuickLook.Common updated: 4da6c69fee...065530d935
@@ -46,6 +46,8 @@ namespace QuickLook
|
||||
}
|
||||
public IViewer Plugin { get; private set; }
|
||||
public ContextObject ContextObject { get; private set; }
|
||||
public Themes CurrentTheme {get; private set; }
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
@@ -84,11 +86,13 @@ namespace QuickLook
|
||||
|
||||
if (isDark)
|
||||
{
|
||||
CurrentTheme = Themes.Dark;
|
||||
if (!Resources.MergedDictionaries.Contains(_darkDict))
|
||||
Resources.MergedDictionaries.Add(_darkDict);
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentTheme = Themes.Light;
|
||||
if (Resources.MergedDictionaries.Contains(_darkDict))
|
||||
Resources.MergedDictionaries.Remove(_darkDict);
|
||||
}
|
||||
|
@@ -102,14 +102,36 @@ namespace QuickLook
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
||||
WindowHelper.RemoveWindowControls(this);
|
||||
|
||||
if (SettingHelper.Get("UseTransparency", true)
|
||||
&& SystemParameters.IsGlassEnabled
|
||||
&& (App.IsWin10 || App.IsWin11)
|
||||
&& !App.IsGPUInBlacklist
|
||||
)
|
||||
WindowHelper.EnableBlur(this);
|
||||
&& !App.IsGPUInBlacklist)
|
||||
{
|
||||
if (App.IsWin11)
|
||||
{
|
||||
if (Environment.OSVersion.Version >= new Version(10, 0, 22523))
|
||||
{
|
||||
WindowHelper.EnableBackdropMicaBlur(this, CurrentTheme == Themes.Dark);
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowHelper.EnableMicaBlur(this, CurrentTheme == Themes.Dark);
|
||||
}
|
||||
}
|
||||
else if (App.IsWin10)
|
||||
{
|
||||
WindowHelper.EnableBlur(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
Background = (Brush)FindResource("MainWindowBackgroundNoTransparent");
|
||||
}
|
||||
}
|
||||
else
|
||||
Background = (Brush) FindResource("MainWindowBackgroundNoTransparent");
|
||||
{
|
||||
Background = (Brush)FindResource("MainWindowBackgroundNoTransparent");
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveWindowSizeOnSizeChanged(object sender, SizeChangedEventArgs e)
|
||||
|
Reference in New Issue
Block a user