Implement DBViewer

This commit is contained in:
Infi
2024-05-22 14:53:30 +02:00
parent 1d2b718f11
commit c2131eb07b
7 changed files with 583 additions and 1 deletions
+19
View File
@@ -298,6 +298,25 @@ internal static class ImGuiUtil
}
}
public static void DrawArrows(ref int selected, int min, int max, float spacing, int id = 0)
{
// Prevents changing values from triggering EndDisable
var isMin = selected == 1;
var isMax = selected == max;
ImGui.SameLine(0, spacing);
using (ImRaii.Disabled(isMin))
{
if (IconButton(FontAwesomeIcon.ArrowLeft, id.ToString())) selected--;
}
ImGui.SameLine(0, spacing);
using (ImRaii.Disabled(isMax))
{
if (IconButton(FontAwesomeIcon.ArrowRight, id+1.ToString())) selected++;
}
}
internal static bool TryToImGui(this VirtualKey key, out ImGuiKey result)
{
result = key switch {