Browse Source

add previewer mode property to remote widget

pull/1975/head
Dan Walmsley 8 years ago
parent
commit
4cfd5a9a03
  1. 18
      src/Avalonia.Controls/Remote/RemoteWidget.cs

18
src/Avalonia.Controls/Remote/RemoteWidget.cs

@ -28,6 +28,8 @@ namespace Avalonia.Controls.Remote
});
}
public bool PreviewerMode { get; set; }
private void OnMessage(object msg)
{
if (msg is FrameMessage frame)
@ -44,13 +46,17 @@ namespace Avalonia.Controls.Remote
protected override void ArrangeCore(Rect finalRect)
{
_connection.Send(new ClientViewportAllocatedMessage
if (!PreviewerMode)
{
Width = finalRect.Width,
Height = finalRect.Height,
DpiX = 96,
DpiY = 96 //TODO: Somehow detect the actual DPI
});
_connection.Send(new ClientViewportAllocatedMessage
{
Width = finalRect.Width,
Height = finalRect.Height,
DpiX = 10 * 96,
DpiY = 10 * 96 //TODO: Somehow detect the actual DPI
});
}
base.ArrangeCore(finalRect);
}

Loading…
Cancel
Save