diff --git a/HellionChat/Ui/Components/TimestampColumn.cs b/HellionChat/Ui/Components/TimestampColumn.cs new file mode 100644 index 0000000..66631d7 --- /dev/null +++ b/HellionChat/Ui/Components/TimestampColumn.cs @@ -0,0 +1,17 @@ +namespace HellionChat.Ui.Components; + +// TEST-MIRROR: Ui/TimestampColumnTests.cs +// +// The timestamp sits in a column of fixed width so the sender names below each +// other actually line up. The mockup asks for tabular figures; ImGui exposes no +// font features, and whether the bundled face even has equal-width digits is +// unverified. So the width comes from measuring the widest shape the format can +// produce, once per layout change rather than per row. +// +// Eights, not zeroes: in most faces 8 is the widest digit. A column measured +// from 00:00 would be undercut by a 10:38 and shove the name column right on +// that one row -- exactly the misalignment this exists to remove. +internal static class TimestampColumn +{ + internal static string SampleFor(bool use24Hour) => use24Hour ? "88:88" : "88:88 PM"; +}