feat: implement resizing logic.

This commit is contained in:
rabbitism
2024-02-05 22:06:17 +08:00
parent fd85efd895
commit 36c63b6326
6 changed files with 97 additions and 20 deletions

View File

@@ -46,6 +46,30 @@ public partial class OverlayDialogHost
control.Width = this.Bounds.Width;
}
}
private static void ResetDrawerPosition(DrawerControlBase control, Size newSize)
{
if (control.Position == Position.Right)
{
control.Height = newSize.Height;
SetLeft(control, newSize.Width - control.Bounds.Width);
}
else if (control.Position == Position.Left)
{
control.Height = newSize.Height;
SetLeft(control, 0);
}
else if (control.Position == Position.Bottom)
{
control.Width = newSize.Width;
SetTop(control, 0);
}
else
{
control.Width = newSize.Width;
SetTop(control, newSize.Height-control.Bounds.Height);
}
}
private Animation CreateAnimation(Size elementBounds, Position position, bool appear = true)
{