Merge pull request #1591 from GF-Huang/fix-#1277

Fix #1277.
This commit is contained in:
NaBian authored and GitHub committed 2024-07-06 16:46:13 +08:00
commit 1a5d6f4f17
2 files changed
+9 -4

No files matched your search

@@ -8,6 +8,8 @@ using HandyControl.Data;
using HandyControl.Tools; using HandyControl.Tools;
using HandyControl.Tools.Extension; using HandyControl.Tools.Extension;
using HandyControl.Tools.Interop; using HandyControl.Tools.Interop;
using HandyControl.Tools.Helper;
#if NET40 #if NET40
using Microsoft.Windows.Shell; using Microsoft.Windows.Shell;
#else #else
@@ -61,10 +63,14 @@ namespace HandyControl.Controls
#else #else
var chrome = new WindowChrome var chrome = new WindowChrome
{ {
CornerRadius = new CornerRadius(),
GlassFrameThickness = new Thickness(0, 0, 0, 1),
UseAeroCaptionButtons = false UseAeroCaptionButtons = false
}; };
if (SystemHelper.GetSystemVersionInfo() < SystemVersionInfo.Windows11_22H2)
{
chrome.GlassFrameThickness = new Thickness(0, 0, 0, 1);
chrome.CornerRadius = new CornerRadius();
}
#endif #endif
BindingOperations.SetBinding(chrome, WindowChrome.CaptionHeightProperty, BindingOperations.SetBinding(chrome, WindowChrome.CaptionHeightProperty,
new Binding(NonClientAreaHeightProperty.Name) { Source = this }); new Binding(NonClientAreaHeightProperty.Name) { Source = this });
@@ -8,10 +8,9 @@ namespace HandyControl.Data;
public readonly struct SystemVersionInfo public readonly struct SystemVersionInfo
{ {
public static SystemVersionInfo Windows10 => new(10, 0, 10240); public static SystemVersionInfo Windows10 => new(10, 0, 10240);
public static SystemVersionInfo Windows10_1809 => new(10, 0, 17763); public static SystemVersionInfo Windows10_1809 => new(10, 0, 17763);
public static SystemVersionInfo Windows10_1903 => new(10, 0, 18362); public static SystemVersionInfo Windows10_1903 => new(10, 0, 18362);
public static SystemVersionInfo Windows11_22H2 => new(10, 0, 22621);
public SystemVersionInfo(int major, int minor, int build) public SystemVersionInfo(int major, int minor, int build)
{ {