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
|
|
@ -1,6 +1,7 @@
|
|||
using AcDream.App.Rendering;
|
||||
using AcDream.App.UI;
|
||||
using DatReaderWriter;
|
||||
using DatReaderWriter.DBObjs;
|
||||
using DatReaderWriter.Options;
|
||||
using SysEnv = System.Environment;
|
||||
|
||||
|
|
@ -8,6 +9,47 @@ namespace AcDream.App.Tests.UI;
|
|||
|
||||
public sealed class RetailCursorCatalogTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(CursorFeedbackKind.WindowMove, 0x06006119u)]
|
||||
[InlineData(CursorFeedbackKind.ResizeHorizontal, 0x06006128u)]
|
||||
[InlineData(CursorFeedbackKind.ResizeVertical, 0x06005E66u)]
|
||||
[InlineData(CursorFeedbackKind.ResizeDiagonalNwse, 0x06006126u)]
|
||||
[InlineData(CursorFeedbackKind.ResizeDiagonalNesw, 0x06006127u)]
|
||||
public void WindowControlCursorSpecs_matchRetailLayoutDescMedia(
|
||||
CursorFeedbackKind kind,
|
||||
uint expectedDid)
|
||||
{
|
||||
Assert.True(RetailCursorCatalog.TryGetWindowControlCursor(kind, out var cursor));
|
||||
Assert.Equal(new UiCursorMedia(expectedDid, 16, 16), cursor);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WindowControlCursorSpecs_resolveGoldenDatSurfaces()
|
||||
{
|
||||
string? datDir = ResolveDatDir();
|
||||
if (datDir is null)
|
||||
return;
|
||||
|
||||
using var dats = new DatCollection(datDir, DatAccessType.Read);
|
||||
CursorFeedbackKind[] kinds =
|
||||
[
|
||||
CursorFeedbackKind.WindowMove,
|
||||
CursorFeedbackKind.ResizeHorizontal,
|
||||
CursorFeedbackKind.ResizeVertical,
|
||||
CursorFeedbackKind.ResizeDiagonalNwse,
|
||||
CursorFeedbackKind.ResizeDiagonalNesw,
|
||||
];
|
||||
|
||||
foreach (CursorFeedbackKind kind in kinds)
|
||||
{
|
||||
Assert.True(RetailCursorCatalog.TryGetWindowControlCursor(kind, out var cursor));
|
||||
Assert.True(dats.Portal.TryGet<RenderSurface>(cursor.File, out var surface), kind.ToString());
|
||||
Assert.NotNull(surface);
|
||||
Assert.Equal(32, surface.Width);
|
||||
Assert.Equal(32, surface.Height);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(RetailGlobalCursorKind.Default, 0x01u, 0, 0)]
|
||||
[InlineData(RetailGlobalCursorKind.DefaultFound, 0x02u, 0, 0)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue