feat(chat): the sample the timestamp column measures against
Eights rather than zeroes. In most faces 8 is the widest digit, and a column measured from 00:00 gets undercut by a 10:38 -- which would shove the name column right on exactly that row, the misalignment the column exists to remove. Two samples because the twelve-hour form is wider. That difference is why Use24HourClock has to enter the layout fingerprint: switching it moves every wrap position after the stamp, and the height cache never knew.
This commit is contained in:
@@ -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";
|
||||
}
|
||||
Reference in New Issue
Block a user