fix(ui): restore retail magic shortcut bar

Port the retail horizontal ItemList empty-slot padding and share UIItem shortcut-number graphics with the status toolbar. Preserve all authored face children on compound DAT buttons so the three-piece Cast control reflows and renders as one complete button.

Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-15 19:11:07 +02:00
parent 0527325b25
commit e3605672bb
12 changed files with 466 additions and 62 deletions

View file

@ -61,6 +61,38 @@ public class UiItemListTests
Assert.Equal((17, 9), (received.Value.X, received.Value.Y));
}
[Fact]
public void RetailHorizontalEmptySlots_FillViewport_AndShrinkOnlyEmptyTail()
{
var list = new UiItemList
{
Width = 130f,
Height = 32f,
CellWidth = 32f,
CellHeight = 32f,
SingleRow = true,
FillVisibleEmptySlots = true,
EmptySlotFactory = () => new UiCatalogSlot(),
};
list.Flush();
list.AddItem(new UiCatalogSlot { EntryId = 42u });
list.LayoutCells();
Assert.Equal(4, list.GetNumUIItems());
Assert.Equal((0f, 32f, 64f, 96f),
(list.GetItem(0)!.Left, list.GetItem(1)!.Left,
list.GetItem(2)!.Left, list.GetItem(3)!.Left));
list.Width = 65f;
list.LayoutCells();
Assert.Equal(2, list.GetNumUIItems());
Assert.Equal(42u, Assert.IsType<UiCatalogSlot>(list.GetItem(0)).EntryId);
list.Width = 16f;
list.LayoutCells();
Assert.Single(list.Children); // the occupied cell is never discarded
}
[Fact]
public void ScrollItemIntoView_moves_only_when_row_is_outside_viewport()
{