Some stashed changes already applied.

This commit is contained in:
Ottermandias 2024-11-22 00:43:36 +01:00
parent f2bdaf1b49
commit ee48ea0166
10 changed files with 55 additions and 23 deletions

View file

@ -29,7 +29,8 @@ internal sealed class ResourceWatcherTable : Table<Record>
new HandleColumn { Label = "Resource" },
new LoadStateColumn { Label = "State" },
new RefCountColumn { Label = "#Ref" },
new DateColumn { Label = "Time" }
new DateColumn { Label = "Time" },
new Crc64Column { Label = "Crc64" }
)
{ }
@ -144,6 +145,21 @@ internal sealed class ResourceWatcherTable : Table<Record>
=> ImGui.TextUnformatted($"{item.Time.ToLongTimeString()}.{item.Time.Millisecond:D4}");
}
private sealed class Crc64Column : ColumnString<Record>
{
public override float Width
=> UiBuilder.MonoFont.GetCharAdvance('0') * 17;
public override unsafe string ToName(Record item)
=> item.Crc64 != 0 ? $"{item.Crc64:X16}" : string.Empty;
public override unsafe void DrawColumn(Record item, int _)
{
using var font = ImRaii.PushFont(UiBuilder.MonoFont, item.Handle != null);
ImUtf8.Text(ToName(item));
}
}
private sealed class CollectionColumn : ColumnString<Record>
{