fix(ui): port retail window control feedback
Map synthetic move and resize affordances to the exact DAT cursors, make chat top chrome movable, and replace stale primary-panel height caps with a dynamic screen-edge constraint. This keeps the retained wrapper adaptation aligned with retail Dragbar/Resizebar behavior.
This commit is contained in:
parent
3f3cfdac30
commit
06016014bc
16 changed files with 578 additions and 27 deletions
|
|
@ -349,6 +349,56 @@ public class UiRootInputTests
|
|||
root.OnMouseUp(UiMouseButton.Left, 338, 150);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BottomResize_ConstrainedToParent_ReachesCurrentScreenEdge()
|
||||
{
|
||||
var root = new UiRoot { Width = 800, Height = 600 };
|
||||
var window = new UiPanel
|
||||
{
|
||||
Left = 100,
|
||||
Top = 80,
|
||||
Width = 300,
|
||||
Height = 200,
|
||||
Draggable = true,
|
||||
Resizable = true,
|
||||
ResizeX = false,
|
||||
ResizeY = true,
|
||||
ResizableEdges = ResizeEdges.Bottom,
|
||||
ConstrainResizeToParent = true,
|
||||
MinHeight = 100,
|
||||
};
|
||||
root.AddChild(window);
|
||||
|
||||
root.OnMouseDown(UiMouseButton.Left, 250, 279);
|
||||
root.OnMouseMove(250, 2_000);
|
||||
|
||||
Assert.Equal(520f, window.Height);
|
||||
Assert.Equal(root.Height, window.Top + window.Height);
|
||||
root.OnMouseUp(UiMouseButton.Left, 250, 2_000);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TopWithoutTopResizeEdge_IsWindowMoveAffordance()
|
||||
{
|
||||
var root = new UiRoot { Width = 800, Height = 600 };
|
||||
var window = new UiPanel
|
||||
{
|
||||
Left = 100,
|
||||
Top = 80,
|
||||
Width = 300,
|
||||
Height = 200,
|
||||
Draggable = true,
|
||||
Resizable = true,
|
||||
ResizableEdges = ResizeEdges.Left | ResizeEdges.Right | ResizeEdges.Bottom,
|
||||
};
|
||||
root.AddChild(window);
|
||||
|
||||
root.OnMouseMove(250, 80);
|
||||
|
||||
Assert.Equal(ResizeEdges.None, root.HoverResizeEdges);
|
||||
Assert.True(root.HoverWindowMove);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ResizeRect_RightBottom_GrowsSizeOnly()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue