fix(D.2b): Slice 2 — Slots caption white + left-aligned (visual gate)
User gate: the "Slots" toggle caption was gold (should be white) and centered (should sit at the left, before the slots). UiButton gains a LabelAlignment (Center default / Left); the paperdoll caption is set white + Left-aligned. The retail checkbox box (green-checked / circle-unchecked) + the exact pose are the two remaining pieces, done next. Build + full App suite green (596). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8ee3d89feb
commit
594942f127
2 changed files with 14 additions and 4 deletions
|
|
@ -47,6 +47,13 @@ public sealed class UiButton : UiElement
|
|||
/// <summary>Label color (default white).</summary>
|
||||
public Vector4 LabelColor { get; set; } = Vector4.One;
|
||||
|
||||
/// <summary>Horizontal alignment of <see cref="Label"/>. Center (default) for normal buttons;
|
||||
/// Left for the paperdoll "Slots" caption that sits at the left edge, before the slots.</summary>
|
||||
public LabelAlignment LabelAlign { get; set; } = LabelAlignment.Center;
|
||||
|
||||
/// <summary>Label horizontal alignment options.</summary>
|
||||
public enum LabelAlignment { Center, Left }
|
||||
|
||||
/// <summary>
|
||||
/// Active state name, runtime-settable (e.g. Max/Min toggling Normal ↔ Minimized).
|
||||
/// Matches <see cref="UiDatElement.ActiveState"/>.
|
||||
|
|
@ -106,8 +113,10 @@ public sealed class UiButton : UiElement
|
|||
|
||||
if (Label is { Length: > 0 } label && LabelFont is { } lf)
|
||||
{
|
||||
float tx = (Width - lf.MeasureWidth(label)) * 0.5f;
|
||||
float ty = (Height - lf.LineHeight) * 0.5f;
|
||||
float tx = LabelAlign == LabelAlignment.Left
|
||||
? 3f // small left pad (room for a future checkbox box)
|
||||
: (Width - lf.MeasureWidth(label)) * 0.5f; // centered (default)
|
||||
float ty = (Height - lf.LineHeight) * 0.5f;
|
||||
ctx.DrawStringDat(lf, label, tx, ty, LabelColor);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue