fix(ui): talk-button caption centers per the authored label child
Owner screenshot pair (2026-08-24): retail centers 'Chat' in the whole 46x17 face; we drew it at the synthetic 20px left indent. The caption child (0x10000015) spans the full button with H=Center/V=Center and no margins (live-DAT probed) — the controller now derives ButtonTextCentered from the authored HJustify instead of leaving the indent default. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
67e963524b
commit
aa94ddebe3
2 changed files with 8 additions and 1 deletions
|
|
@ -492,6 +492,11 @@ public sealed class ChatWindowController : IRetainedWindowStateController, IReta
|
|||
if (labelInfo.FontDid != 0u
|
||||
&& resolveFont?.Invoke(labelInfo.FontDid) is { } buttonFont)
|
||||
menu.ButtonDatFont = buttonFont;
|
||||
// The child spans the FULL 46x17 with H=Center (probed) —
|
||||
// retail centers 'Chat'/'Gen' in the whole face, not at a
|
||||
// fixed left indent (owner screenshot pair, 2026-08-24).
|
||||
menu.ButtonTextCentered =
|
||||
labelInfo.HJustify == HJustify.Center;
|
||||
}
|
||||
menu.NormalSprite = MenuNormal; menu.PressedSprite = MenuPressed;
|
||||
menu.PopupBgSprite = MenuPopupBg;
|
||||
|
|
|
|||
|
|
@ -768,8 +768,10 @@ public class ChatLayoutConformanceTests
|
|||
Assert.Equal(46f, menu.Width);
|
||||
menu.OnSelect!.Invoke(ChatChannelKind.General);
|
||||
Assert.Equal(46f, menu.Width);
|
||||
// Authored caption color: pure white.
|
||||
// Authored caption color: pure white; authored H=Center over the
|
||||
// full 46x17 face (not the synthetic 20px left indent).
|
||||
Assert.Equal(new System.Numerics.Vector4(1f, 1f, 1f, 1f), menu.TextColor);
|
||||
Assert.True(menu.ButtonTextCentered);
|
||||
|
||||
var send = Assert.IsType<UiButton>(layout.FindElement(0x10000019u));
|
||||
Assert.Equal(new System.Numerics.Vector4(1f, 1f, 1f, 1f), send.LabelColor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue