Browse Source

Fix regression

pull/6076/head
Nathan Garside 5 years ago
parent
commit
e652419927
  1. 16
      src/Avalonia.Controls/TopLevel.cs
  2. 1
      src/Avalonia.Controls/Window.cs
  3. 1
      src/Avalonia.Controls/WindowBase.cs

16
src/Avalonia.Controls/TopLevel.cs

@ -168,6 +168,7 @@ namespace Avalonia.Controls
styler?.ApplyStyles(this);
ClientSize = impl.ClientSize;
FrameSize = impl.FrameSize;
this.GetObservable(PointerOverElementProperty)
.Select(
@ -207,7 +208,11 @@ namespace Avalonia.Controls
/// <summary>
/// Gets or sets the total size of the window.
/// </summary>
public Size FrameSize => _frameSize;
public Size FrameSize
{
get { return _frameSize; }
protected set { SetAndRaise(FrameSizeProperty, ref _frameSize, value); }
}
/// <summary>
/// Gets or sets the <see cref="WindowTransparencyLevel"/> that the TopLevel should use when possible.
@ -378,6 +383,7 @@ namespace Avalonia.Controls
protected virtual void HandleResized(Size clientSize)
{
ClientSize = clientSize;
FrameSize = PlatformImpl.FrameSize;
Width = clientSize.Width;
Height = clientSize.Height;
LayoutManager.ExecuteLayoutPass();
@ -457,14 +463,6 @@ namespace Avalonia.Controls
/// <param name="e">The event args.</param>
protected virtual void OnClosed(EventArgs e) => Closed?.Invoke(this, e);
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
{
if (change.Property == ClientSizeProperty)
{
SetAndRaise(FrameSizeProperty, ref _frameSize, PlatformImpl.FrameSize);
}
}
/// <summary>
/// Tries to get a service from an <see cref="IAvaloniaDependencyResolver"/>, logging a
/// warning if not found.

1
src/Avalonia.Controls/Window.cs

@ -950,7 +950,6 @@ namespace Avalonia.Controls
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
{
base.OnPropertyChanged(change);
if (change.Property == SystemDecorationsProperty)
{
var typedNewValue = change.NewValue.GetValueOrDefault<SystemDecorations>();

1
src/Avalonia.Controls/WindowBase.cs

@ -222,6 +222,7 @@ namespace Avalonia.Controls
protected override void HandleResized(Size clientSize)
{
ClientSize = clientSize;
FrameSize = PlatformImpl.FrameSize;
LayoutManager.ExecuteLayoutPass();
Renderer?.Resized(clientSize);
}

Loading…
Cancel
Save