fix: make grouping work

This commit is contained in:
Anna 2024-02-18 15:04:57 -05:00
parent 14f96ff6ba
commit d1ae176f29
Signed by: anna
GPG Key ID: D0943384CD9F87D1

View File

@ -44,11 +44,11 @@ internal class DatabaseTab : ITab {
var first = true;
foreach (var groupBy in this.GroupBys) {
if (first) {
ImGui.TextUnformatted($"Group by {Enum.GetName(groupBy)}");
} else {
ImGui.TextUnformatted($"then by {Enum.GetName(groupBy)}");
}
ImGui.TextUnformatted(
first
? $"Group by {Enum.GetName(groupBy)}"
: $"then by {Enum.GetName(groupBy)}"
);
first = false;
}
@ -134,6 +134,14 @@ internal class DatabaseTab : ITab {
foreach (var grouping in grouped) {
var label = grouping.Key;
// FIXME: label should be unique (pushid?)
if (!ImGui.TreeNodeEx(label)) {
continue;
}
using var treePop = new OnDispose(ImGui.TreePop);
if (groupBy.Next == null) {
this.DrawShots(grouping);
} else {