Browse Source
Merge branch 'master' into fixes/getCharacterHitFromDistance
pull/12322/head
Benedikt Stebner
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
15 additions and
9 deletions
-
src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs
-
src/Windows/Avalonia.Win32/WindowImpl.cs
-
src/tools/Avalonia.Generators/Common/XamlXNameResolver.cs
-
tests/Avalonia.Generators.Tests/Views/NamedControl.xml
-
tests/Avalonia.Generators.Tests/Views/xNamedControl.xml
|
|
|
@ -59,7 +59,7 @@ namespace Avalonia.Win32 |
|
|
|
|
|
|
|
case WindowsMessage.WM_NCCALCSIZE: |
|
|
|
{ |
|
|
|
if (ToInt32(wParam) == 1 && !HasFullDecorations || _isClientAreaExtended) |
|
|
|
if (ToInt32(wParam) == 1 && _windowProperties.Decorations == SystemDecorations.None || _isClientAreaExtended) |
|
|
|
{ |
|
|
|
return IntPtr.Zero; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1340,14 +1340,12 @@ namespace Avalonia.Win32 |
|
|
|
|
|
|
|
if (!_isFullScreenActive) |
|
|
|
{ |
|
|
|
var margin = newProperties.Decorations == SystemDecorations.BorderOnly ? 1 : 0; |
|
|
|
|
|
|
|
var margins = new MARGINS |
|
|
|
{ |
|
|
|
cyBottomHeight = margin, |
|
|
|
cxRightWidth = margin, |
|
|
|
cxLeftWidth = margin, |
|
|
|
cyTopHeight = margin |
|
|
|
cyBottomHeight = 0, |
|
|
|
cxRightWidth = 0, |
|
|
|
cxLeftWidth = 0, |
|
|
|
cyTopHeight = 0 |
|
|
|
}; |
|
|
|
|
|
|
|
DwmExtendFrameIntoClientArea(_hwnd, ref margins); |
|
|
|
|
|
|
|
@ -38,6 +38,7 @@ internal class XamlXNameResolver : INameResolver, IXamlAstVisitor |
|
|
|
{ |
|
|
|
if (child is XamlAstXamlPropertyValueNode propertyValueNode && |
|
|
|
propertyValueNode.Property is XamlAstNamePropertyReference namedProperty && |
|
|
|
!IsAttachedProperty(namedProperty) && |
|
|
|
namedProperty.Name == "Name" && |
|
|
|
propertyValueNode.Values.Count > 0 && |
|
|
|
propertyValueNode.Values[0] is XamlAstTextNode text) |
|
|
|
@ -89,4 +90,9 @@ internal class XamlXNameResolver : INameResolver, IXamlAstVisitor |
|
|
|
_ => _defaultFieldModifier |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
private static bool IsAttachedProperty(XamlAstNamePropertyReference namedProperty) |
|
|
|
{ |
|
|
|
return !namedProperty.DeclaringType.Equals(namedProperty.TargetType); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -2,6 +2,7 @@ |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
x:Class="Sample.App.NamedControl"> |
|
|
|
<TextBox Name="UserNameTextBox" |
|
|
|
AutomationProperties.Name="The user name" |
|
|
|
Watermark="Username input" |
|
|
|
UseFloatingWatermark="True" /> |
|
|
|
</Window> |
|
|
|
</Window> |
|
|
|
|
|
|
|
@ -2,6 +2,7 @@ |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
x:Class="Sample.App.xNamedControl"> |
|
|
|
<TextBox x:Name="UserNameTextBox" |
|
|
|
AutomationProperties.Name="The user name" |
|
|
|
Watermark="Username input" |
|
|
|
UseFloatingWatermark="True" /> |
|
|
|
</Window> |
|
|
|
</Window> |
|
|
|
|