mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-07 13:38:00 +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 IViewer Plugin { get; private set; }
|
||||||
public ContextObject ContextObject { get; private set; }
|
public ContextObject ContextObject { get; private set; }
|
||||||
|
public Themes CurrentTheme {get; private set; }
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
[NotifyPropertyChangedInvocator]
|
[NotifyPropertyChangedInvocator]
|
||||||
@@ -84,11 +86,13 @@ namespace QuickLook
|
|||||||
|
|
||||||
if (isDark)
|
if (isDark)
|
||||||
{
|
{
|
||||||
|
CurrentTheme = Themes.Dark;
|
||||||
if (!Resources.MergedDictionaries.Contains(_darkDict))
|
if (!Resources.MergedDictionaries.Contains(_darkDict))
|
||||||
Resources.MergedDictionaries.Add(_darkDict);
|
Resources.MergedDictionaries.Add(_darkDict);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
CurrentTheme = Themes.Light;
|
||||||
if (Resources.MergedDictionaries.Contains(_darkDict))
|
if (Resources.MergedDictionaries.Contains(_darkDict))
|
||||||
Resources.MergedDictionaries.Remove(_darkDict);
|
Resources.MergedDictionaries.Remove(_darkDict);
|
||||||
}
|
}
|
||||||
|
@@ -102,14 +102,36 @@ namespace QuickLook
|
|||||||
{
|
{
|
||||||
base.OnApplyTemplate();
|
base.OnApplyTemplate();
|
||||||
|
|
||||||
|
WindowHelper.RemoveWindowControls(this);
|
||||||
|
|
||||||
if (SettingHelper.Get("UseTransparency", true)
|
if (SettingHelper.Get("UseTransparency", true)
|
||||||
&& SystemParameters.IsGlassEnabled
|
&& SystemParameters.IsGlassEnabled
|
||||||
&& (App.IsWin10 || App.IsWin11)
|
&& !App.IsGPUInBlacklist)
|
||||||
&& !App.IsGPUInBlacklist
|
{
|
||||||
)
|
if (App.IsWin11)
|
||||||
WindowHelper.EnableBlur(this);
|
{
|
||||||
|
if (Environment.OSVersion.Version >= new Version(10, 0, 22523))
|
||||||
|
{
|
||||||
|
WindowHelper.EnableBackdropMicaBlur(this, CurrentTheme == Themes.Dark);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Background = (Brush) FindResource("MainWindowBackgroundNoTransparent");
|
{
|
||||||
|
WindowHelper.EnableMicaBlur(this, CurrentTheme == Themes.Dark);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (App.IsWin10)
|
||||||
|
{
|
||||||
|
WindowHelper.EnableBlur(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Background = (Brush)FindResource("MainWindowBackgroundNoTransparent");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Background = (Brush)FindResource("MainWindowBackgroundNoTransparent");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveWindowSizeOnSizeChanged(object sender, SizeChangedEventArgs e)
|
private void SaveWindowSizeOnSizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
|
Reference in New Issue
Block a user