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);