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
1 changed files with 15 additions and 7 deletions

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;
}
@ -59,8 +59,8 @@ internal class DatabaseTab : ITab {
}
var comboSize = ImGui.GetContentRegionAvail().X
- buttonSize.X
- ImGui.GetStyle().ItemSpacing.X;
- buttonSize.X
- ImGui.GetStyle().ItemSpacing.X;
ImGui.SetNextItemWidth(comboSize);
if (ImGui.BeginCombo("##then-by", Enum.GetName(this._selectedGroupBy))) {
@ -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 {