fix: make grouping work
This commit is contained in:
parent
14f96ff6ba
commit
d1ae176f29
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue