fix: add delete button for groupings

This commit is contained in:
Anna 2024-02-18 20:52:49 -05:00
parent 8fc2a5388b
commit 1c50528fee
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 12 additions and 0 deletions

View File

@ -44,15 +44,27 @@ internal class DatabaseTab : ITab {
}
var first = true;
GroupBy? remove = null;
foreach (var groupBy in this.GroupBys) {
ImGui.TextUnformatted(
first
? $"Group by {Enum.GetName(groupBy)}"
: $"then by {Enum.GetName(groupBy)}"
);
ImGui.SameLine();
if (ImGuiComponents.IconButton($"remove-{groupBy}", FontAwesomeIcon.Times)) {
remove = groupBy;
}
first = false;
}
if (remove != null) {
this.GroupBys.Remove(remove.Value);
}
Vector2 buttonSize;
ImGui.PushFont(UiBuilder.IconFont);
using (new OnDispose(ImGui.PopFont)) {