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
|
|
@ -341,11 +341,31 @@ public sealed class UiRoot : UiElement
|
|||
// Window resize takes precedence over move / drag-drop / hover.
|
||||
if (_resizeTarget is not null)
|
||||
{
|
||||
float maxWidth = _resizeTarget.MaxWidth;
|
||||
float maxHeight = _resizeTarget.MaxHeight;
|
||||
if (_resizeTarget.ConstrainResizeToParent
|
||||
&& _resizeTarget.Parent is { } resizeParent)
|
||||
{
|
||||
// The opposite edge remains fixed during a resize. Limit the
|
||||
// dragged edge to its current parent, using the interaction's
|
||||
// start rect so the clamp remains stable throughout the drag.
|
||||
maxWidth = MathF.Min(
|
||||
maxWidth,
|
||||
(_resizeEdges & ResizeEdges.Left) != 0
|
||||
? _resizeStartX + _resizeStartW
|
||||
: resizeParent.Width - _resizeStartX);
|
||||
maxHeight = MathF.Min(
|
||||
maxHeight,
|
||||
(_resizeEdges & ResizeEdges.Top) != 0
|
||||
? _resizeStartY + _resizeStartH
|
||||
: resizeParent.Height - _resizeStartY);
|
||||
}
|
||||
var (nx, ny, nw, nh) = ResizeRect(
|
||||
_resizeStartX, _resizeStartY, _resizeStartW, _resizeStartH,
|
||||
_resizeEdges, x - _resizeMouseX, y - _resizeMouseY,
|
||||
_resizeTarget.MinWidth, _resizeTarget.MinHeight,
|
||||
_resizeTarget.MaxWidth, _resizeTarget.MaxHeight);
|
||||
MathF.Max(_resizeTarget.MinWidth, maxWidth),
|
||||
MathF.Max(_resizeTarget.MinHeight, maxHeight));
|
||||
_resizeTarget.Left = nx; _resizeTarget.Top = ny;
|
||||
_resizeTarget.Width = nw; _resizeTarget.Height = nh;
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue