Browse Source
Merge pull request #7787 from AvaloniaUI/fixes/mica-acrylic-fallback-win32
make mica fallback to acrylic on compatible windows 10
pull/7788/head
Dan Walmsley
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
1 deletions
-
src/Avalonia.Controls/WindowTransparencyLevel.cs
-
src/Windows/Avalonia.Win32/WindowImpl.cs
|
|
|
@ -22,6 +22,11 @@ |
|
|
|
/// </summary>
|
|
|
|
AcrylicBlur, |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Force acrylic on some incompatible versions of Windows 10.
|
|
|
|
/// </summary>
|
|
|
|
ForceAcrylicBlur, |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The window background is based on desktop wallpaper tint with a blur. This will only work on Windows 11
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
@ -396,6 +396,11 @@ namespace Avalonia.Win32 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (Win32Platform.WindowsVersion.Major == 10 && effect == BlurEffect.Mica) |
|
|
|
{ |
|
|
|
effect = BlurEffect.Acrylic; |
|
|
|
} |
|
|
|
|
|
|
|
_blurHost?.SetBlur(effect); |
|
|
|
|
|
|
|
return transparencyLevel; |
|
|
|
@ -428,7 +433,8 @@ namespace Avalonia.Win32 |
|
|
|
break; |
|
|
|
|
|
|
|
case WindowTransparencyLevel.AcrylicBlur: |
|
|
|
case (WindowTransparencyLevel.AcrylicBlur + 1): // hack-force acrylic.
|
|
|
|
case WindowTransparencyLevel.ForceAcrylicBlur: // hack-force acrylic.
|
|
|
|
case WindowTransparencyLevel.Mica: |
|
|
|
accent.AccentState = AccentState.ACCENT_ENABLE_ACRYLIC; |
|
|
|
transparencyLevel = WindowTransparencyLevel.AcrylicBlur; |
|
|
|
break; |
|
|
|
|