From a1e7041ba8edcc9540aa0d38a12eb2e5fed8cff6 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 21 Jun 2026 21:17:28 +0200 Subject: [PATCH] =?UTF-8?q?feat(ui):=20D.2b=20inventory=20finish=20?= =?UTF-8?q?=E2=80=94=20vertical-only=20window=20resize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drag the bottom edge to expand the inventory and see more of the pack (ResizeX=false + ResizableEdges=Bottom blocks horizontal resize). The contents grid + its gm3DItemsUI sub-window + scrollbar + the backdrop stretch vertically (Left|Top|Bottom); the paperdoll + side-bag column stay pinned at the top (Left|Top). The grid's ViewHeight grows → more rows + the scrollbar thumb ratio (view/content) reflects how much is left to scroll. Min = dat default (expand only for now); max = 560. Visually confirmed: scroll + resize work. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/AcDream.App/Rendering/GameWindow.cs | 37 ++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 7f8063ff..56f7fdc5 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -2170,9 +2170,44 @@ public sealed class GameWindow : IDisposable // Content offset by the border so it sits inside the chrome. inventoryRoot.Left = invBorder; inventoryRoot.Top = invBorder; inventoryRoot.Width = invContentW; inventoryRoot.Height = invContentH; - inventoryRoot.Anchors = AcDream.App.UI.AnchorEdges.Left | AcDream.App.UI.AnchorEdges.Top; + // Content fills the frame vertically (Left|Top|Bottom = fixed width + height tracks + // the frame) so a vertical resize grows the inner content. + inventoryRoot.Anchors = AcDream.App.UI.AnchorEdges.Left | AcDream.App.UI.AnchorEdges.Top + | AcDream.App.UI.AnchorEdges.Bottom; inventoryRoot.Draggable = false; inventoryFrame.AddChild(inventoryRoot); + + // Vertical-only resize: drag the BOTTOM edge to expand and see more of the pack. + // ResizeX=false + ResizableEdges=Bottom blocks horizontal resize (user request). + // MinHeight = the dat default (no shrink below it); MaxHeight = toward full screen. + inventoryFrame.Resizable = true; + inventoryFrame.ResizeX = false; + inventoryFrame.ResizableEdges = AcDream.App.UI.ResizeEdges.Bottom; + inventoryFrame.MinHeight = invContentH + 2 * invBorder; + inventoryFrame.MaxHeight = 560f; + + // Stretch the contents region with the window: the gm3DItemsUI sub-window + its grid + // + scrollbar + the full-window backdrop grow vertically (Left|Top|Bottom); the + // paperdoll + side-bag column stay pinned at the top (Left|Top). The grid's ViewHeight + // grows → more rows + the scrollbar thumb ratio (view/content) reflects it. + void StretchV(uint id) + { + if (invLayout!.FindElement(id) is { } el) + el.Anchors = AcDream.App.UI.AnchorEdges.Left | AcDream.App.UI.AnchorEdges.Top + | AcDream.App.UI.AnchorEdges.Bottom; + } + void PinTopLeft(uint id) + { + if (invLayout!.FindElement(id) is { } el) + el.Anchors = AcDream.App.UI.AnchorEdges.Left | AcDream.App.UI.AnchorEdges.Top; + } + StretchV(0x100001D0u); // full-window backdrop + StretchV(0x100001CFu); // gm3DItemsUI sub-window (contents-grid container) + StretchV(0x100001C6u); // contents grid (UiItemList) + StretchV(0x100001C7u); // contents scrollbar + PinTopLeft(0x100001CDu); // paperdoll (fixed at top) + PinTopLeft(0x100001CEu); // side-bag column (fixed at top) + _uiHost.Root.AddChild(inventoryFrame); _uiHost.RegisterWindow(AcDream.App.UI.WindowNames.Inventory, inventoryFrame);