From de967de9fdab779198e9be02eac2c7e96366e12e Mon Sep 17 00:00:00 2001 From: antongit Date: Tue, 11 Oct 2022 08:48:51 +0200 Subject: [PATCH] Added GetStyleColorName. (adds to #29) --- .../Widgets/Queries/GetStyleColorName.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/VL.ImGui/Widgets/Queries/GetStyleColorName.cs diff --git a/src/VL.ImGui/Widgets/Queries/GetStyleColorName.cs b/src/VL.ImGui/Widgets/Queries/GetStyleColorName.cs new file mode 100644 index 0000000..1d8c51d --- /dev/null +++ b/src/VL.ImGui/Widgets/Queries/GetStyleColorName.cs @@ -0,0 +1,18 @@ +namespace VL.ImGui.Widgets +{ + /// + /// Get a string corresponding to the enum value (for display, saving, etc.). + /// + [GenerateNode(Category = "ImGui.Queries", IsStylable = false)] + internal partial class GetStyleColorName : Widget + { + public ImGuiNET.ImGuiCol Color { private get; set; } + + public string? Value { get; private set; } + + internal override unsafe void UpdateCore(Context context) + { + Value = ImGuiNET.ImGui.GetStyleColorName(Color); + } + } +}