From 9e812454159520abd19d819165a422934b0ee6d1 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 22 May 2020 17:27:33 -0300 Subject: [PATCH] extend api only allows to turn titlebar on or off to maintain window integrity, and decoration margins dont include border margins. --- .../Platform/ExtendClientAreaChromeHints.cs | 7 ++- src/Avalonia.Controls/Window.cs | 6 +-- .../CaptionButtons.xaml | 2 +- src/Windows/Avalonia.Win32/WindowImpl.cs | 43 ++----------------- 4 files changed, 9 insertions(+), 49 deletions(-) diff --git a/src/Avalonia.Controls/Platform/ExtendClientAreaChromeHints.cs b/src/Avalonia.Controls/Platform/ExtendClientAreaChromeHints.cs index e98124b2d8..075e4ba436 100644 --- a/src/Avalonia.Controls/Platform/ExtendClientAreaChromeHints.cs +++ b/src/Avalonia.Controls/Platform/ExtendClientAreaChromeHints.cs @@ -6,11 +6,10 @@ namespace Avalonia.Platform public enum ExtendClientAreaChromeHints { NoChrome, - Default = SystemTitleBar | SystemChromeButtons, + Default = SystemTitleBar, SystemTitleBar = 0x01, - SystemChromeButtons = 0x02, - ManagedChromeButtons = 0x04, - PreferSystemChromeButtons = 0x08, + ManagedChromeButtons = 0x02, + PreferSystemChromeButtons = 0x04, AdaptiveChromeWithTitleBar = SystemTitleBar | PreferSystemChromeButtons, AdaptiveChromeWithoutTitleBar = PreferSystemChromeButtons, } diff --git a/src/Avalonia.Controls/Window.cs b/src/Avalonia.Controls/Window.cs index d63b1350bc..8d66e03f98 100644 --- a/src/Avalonia.Controls/Window.cs +++ b/src/Avalonia.Controls/Window.cs @@ -540,11 +540,7 @@ namespace Avalonia.Controls { IsExtendedIntoWindowDecorations = isExtended; - WindowDecorationMargins = new Thickness( - PlatformImpl.ExtendedMargins.Left, - PlatformImpl.ExtendedMargins.Top - PlatformImpl.OffScreenMargin.Top, - PlatformImpl.ExtendedMargins.Right, - PlatformImpl.ExtendedMargins.Bottom); + WindowDecorationMargins = PlatformImpl.ExtendedMargins; OffScreenMargin = PlatformImpl.OffScreenMargin; } diff --git a/src/Avalonia.Themes.Default/CaptionButtons.xaml b/src/Avalonia.Themes.Default/CaptionButtons.xaml index 0cc0d6b9cd..8ee8a3b0dd 100644 --- a/src/Avalonia.Themes.Default/CaptionButtons.xaml +++ b/src/Avalonia.Themes.Default/CaptionButtons.xaml @@ -5,7 +5,7 @@ - +