From ec6471ca87c64e70cbd984265eeedfdf2076d34b Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 1 May 2016 16:06:46 +0200 Subject: [PATCH] TreeNodeEx() wired the display-side ImGuiTreeNodeFlags_Selected flag (#581) --- imgui.cpp | 2 +- imgui.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 47ecc56d..7aff89cc 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5712,7 +5712,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l else { // Unframed typed for tree nodes - if (hovered) + if (hovered || (flags & ImGuiTreeNodeFlags_Selected)) RenderFrame(bb.Min, bb.Max, col, false); RenderCollapseTriangle(bb.Min + ImVec2(padding.x, g.FontSize*0.15f + text_base_offset_y), opened, 0.70f, false); diff --git a/imgui.h b/imgui.h index 953d1f65..11b63b8f 100644 --- a/imgui.h +++ b/imgui.h @@ -518,7 +518,7 @@ enum ImGuiInputTextFlags_ // Flags for ImGui::TreeNode*(), ImGui::CollapsingHeader*() enum ImGuiTreeNodeFlags_ { - ImGuiTreeNodeFlags_Selected = 1 << 0, // FIXME: TODO + ImGuiTreeNodeFlags_Selected = 1 << 0, // Draw as selected ImGuiTreeNodeFlags_Framed = 1 << 1, // Full colored frame (e.g. for CollapsingHeader) ImGuiTreeNodeFlags_AllowOverlapMode = 1 << 2, // Hit testing to allow subsequent widgets to overlap this one ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3, // Don't do a TreePush() when opened (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack